路由文件中的路径有问题
const router = new VueRouter({
mode: 'history',
routes: [
{ path: '/test/', component: YourComponent },
{ path: '/test/a', component: YourComponent },
{ path: '/test/b:x', component: YourComponent }
]})
在路由文件中所有的路径前面加上服务器下项目所在的文件名即可,当然也包括<router-link>和this.$router.push()中的路径,不然又是不讲道理的。
这只是在nginx服务器下的一种解决方案,至于别的服务器应该也是同理的。










