vue-router 子路由时,父级component设置

component使用对象形式,使用render函数进行处理

 1 {
 2   path: '/system',
 3   name: 'System',
 4   meta: {
 5     title: '系统设置',
 6     icon: 'el-icon-setting'
 7   },
 8   component: {
 9     render(h: CreateElement) {
10       return h('router-view')
11     }
12   },
13   children: [
14     {
15       path: 'permission',
16       name: 'Permission',
17       meta: {
18         title: '权限设置',
19         icon: 'el-icon-set-up'
20       },
21       component: () => import('@/views/system/Permission.vue'),
22     },
23   ]
24 }

 

posted @ 2021-03-10 16:17  智走  阅读(2633)  评论(0)    收藏  举报