路由嵌套

为什么?

需求:在一个路径映射一个组件,访问两个路径会分别渲染两个组件

怎么做?

const routes =[

{

path:'/home',

component:()=>important('../comportants/Home'),

children:[

{

path:'/home/news'

component:()=>important('../comportants/Home/news'),

}

]

},

{

component:()=>important('../comportants/About')

}

];

 

posted @ 2020-03-25 18:36  笑看吴钩  阅读(106)  评论(0编辑  收藏  举报