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

时间:2021-03-10 16:32:08   收藏:0   阅读:236

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 }

 

原文:https://www.cnblogs.com/zhizou/p/14512422.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!