在一个页面中分别有三个div,对应三个js文件,分别为其加入设置路由,
对应的js文件如下
但是当第三个路由设置如下
但是当第三个路由设置如下
Vue.use(VueRouter);
const router=new VueRouter({
mode:'history',
routes:[
{
path:'/settings',
component:Levelone,
children:[
{
path:'emails',
component:Levelthree
},
{
path:'profile',
components:{
default:Levelfour,
helper:Levelfive
}
}
]
}
]
})
router.push('/settings/emails')
这时就会使前面两个路由无法正常显示,并且报错
但是当将第三个路由的mode设置为hash,三个路由可以正常显示;
请问这个mode的具体设置的区别在哪里呢,设置为history的时候为什么不能正常显示呢?
慕莱坞森
哔哔one
相关分类