1.项目完成后,npm run build 后,首次进入测试的接口 localhost:9000没有问题,但是当刷新的时候页面就挂掉了?
解决办法去掉mode:'history',开启HTML5 History Mode后,尤其需要server端的支持
let router = new VueRouter({ //mode: 'history',注释掉解决问题 routes: [ { path: '/', redirect: '/goods' }, { path: '/goods', component: goods }, { path: '/ratings', component: ratings }, { path: '/seller', component: seller } ], linkActiveClass: 'active' })