获得徽章 6
- 我遇到一个问题,身边的人都没人能够解答,就是 这个一级路由为什么都要用 component: Layout, 使用插槽不好嘛,一直有这样的疑虑,我看到别人这样用,但我自己说服不了自己
```
{
path: '/home',
component: Layout,
meta: {
icon: 'home'
},
redirect: '/home/index',
children: [
{
path: 'index',
component: () => import('@/pages/home/index.vue'),
meta: {
hidden: true
}
}
]
},
{
path: '/patient',
component: Layout,
meta: {
icon: 'user'
},
redirect: '/patient/index',
children: [
{
path: 'index',
name: 'patientList',
component: () => import('@/pages/patient/index.vue'),
meta: {
hidden: true
},
children: patientRoutes
}
]
}
```展开等人赞过64
![[尬笑]](http://lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_59.8a63cb5.png)
![[发怒]](http://lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_12.0f24f23.png)
```![[疑问]](http://lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_31.606e7a5.png)
![[大哭]](http://lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_60.9016267.png)