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 }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM