现在我做的一个项目是在electron下用vue.js + vue-router + webpack,我就是想问下,在项目打包后,直接打开index.html他是直接访问App.vue,但是我建的路由我试了N多方法,貌似都不行,比如:index.html/login,login是一个组件 login.vue。对了,在开发模式下(npm run dev)用http://localhost:8080/login,这样是可以正常访问的。
我现在能想到的解决方案有两个:
1、有没有什么办法在electron启动的时候启动一个server服务器?没试过,无从下手。
2、是不是webpack在没server的情况下,不能用路由?
求大神指点下。
hello. Can you use vue+express+webpack+mysql as an architecture project? Can you share it with me, dear. I am also learning this knowledge at the moment. Thank you very much if you can answer it
You can take a look at http-server in npm
http://localhost:8080/assert/...
Have you set the history in the routing? If not, open it directly and it should be index.html#/login
If you want to use an http server
npm install -g live-server
Enter the dist folder and execute live-server
I also have a question, how to directly access the static resource files packaged by webpack through the 3000 port opened by express. Describe the single page application I made.