2016-03-03 30 views
0

我创建应用程序电子,浏览器是好的,但环境电子不同意路由路由。在附件I中发送整个屏幕。请指教。 code and electron app在电子应用程序中路由Reactjs

+0

什么版本的react-router是那个?我在2.0.1上遇到了同样的问题。我绕过它的方式是使用哈希历史记录。无论如何,你并没有针对任何SEO工具。 – backman

+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 
相关问题