Vue.js入門(10)路由

序言

 

嵌套路由

路由佔位符

路由參數

{ 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' } });

資料

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章