在电子应用程序中路由Reactjs

时间:2016-03-03 07:38:33

标签: reactjs routing electron

我创建应用程序Electron,浏览器没问题,但环境Electron不同意路由路由。在附件I中发送整个屏幕。请指教。 code and electron app

1 个答案:

答案 0 :(得分:0)

我发现这样做的最好方法是使用path.join,只需要很少的努力就可以了,这对您有用吗?

# IMPORT PATH ES6/7

# es6: const path = require('path');

# CONSTRUCT YOUR BUILD PATH
const build_path = path.join(__dirname), '/build');

# mainWindow.loadURL('file://' + build_path + '/index.html')

console.log('file://' + build_path + '/index.html');
# -> file://build/index.html
相关问题