序言
嵌套路由
路由占位符
路由参数
{ path: ‘/user/:id‘, component: User, props: true },
{ path: ‘/user/:id‘, component: User, props: { uname: ‘lisi‘, age: 20 } },
{
path: ‘/user/:id‘,
component: User,
props: route => ({ uname: ‘zs‘, age: 20, id: route.params.id })
},
props: [‘id‘, ‘uname‘, ‘age‘],
路由导航守卫
this.$store.commit(‘UPDATE_TABBAR_STATUS‘, ‘help-center‘);
this.$router.push({ name: ‘setPassWord‘, query: { hotelStaffType: ‘hotel‘ } });