dist打包后不能用路由访问 财富值4

2016-10-16 20:49发布

我下载了https://github.com/eteplus/vu... 项目,运行npm run dev 时可以访问httpp://localhost:8080/home。
运行npm run build时 使用http-server -p 8081 只能在首页httpp://localhost:8081访问到其它页面,直接访问httpp://localhost:8081/home是访问不到。
是webpack做了限制吗?还是我访问的路由不对呢?

付费偷看设置
发送
1条回答
acer - 这个人很懒,什么都没留下
1楼 · 2016-10-16 21:13.采纳回答

const router = new VueRouter({
hashbang: true,
history: false,//这个参数改为false就可以了
saveScrollPosition: true,
suppressTransitionError: true
})