vue项目,build后,刷新后页面挂掉cannot get

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'

})



posted @ 2017-05-10 15:39  黄先森  阅读(3336)  评论(1编辑  收藏  举报