|
@@ -25,6 +25,9 @@ const routes = [
|
|
|
name:"mypage",
|
|
|
// component 代表路由的组件 当前要显示的页面
|
|
|
component:() => import("../views/MyPage.vue"),
|
|
|
+ // alias 别名
|
|
|
+ alias:'/my',
|
|
|
+ // children 代表子路由
|
|
|
children:[
|
|
|
{
|
|
|
path:'/mypage/childone',
|
|
@@ -35,8 +38,19 @@ const routes = [
|
|
|
path:'/mypage/childtwo',
|
|
|
name:"childtwo",
|
|
|
component:() => import("../views/ChildTwo.vue")
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path:'/mypage/childthree/:username/:age',
|
|
|
+ name:'childthree',
|
|
|
+ component:() => import("../views/ChildThree.vue")
|
|
|
}
|
|
|
]
|
|
|
+ },{
|
|
|
+ path:'/backhome',
|
|
|
+ redirect:'/'
|
|
|
+ },{
|
|
|
+ path:"/gochildthree/:username/:age",
|
|
|
+ redirect:"/mypage/childthree/:username/:age"
|
|
|
}
|
|
|
]
|
|
|
|