运用iview-admin,框架是二级菜单,因营业须要改成三级菜单。其他部份都已经改好,然则页面依然没有出来,页面也没有了报错,比较诡异。
厥后发现题目可能在路由设置,看到了他人写的这个demo,链接:https://jsfiddle.net/767nb8u1/1/
能够看到,嵌套组件中的每一级都有component选项,好像是必需的(页面也没有了报错),chidren选项中的component父子两级同时衬着,这一定不是我们所须要的,知乎有人如许处理的:
增加了中间层:artical-publish-center.vue
内容以下:
<template>
<router-view></router-view>
</template>
<script>
export default {
}
</script>
做中间层,将终究的路由转接过去。如许就轻松的处理了这个题目。以下是我的路由设置项。
{
path: '/form',
icon: 'settings',
name: 'form',
title: '系统设置',
component: Main,
children: [
{ path: 'artical-publish',
title: '用户设置',
name: 'artical-publish',
icon: 'compose',
component: () => import('@/views/form/article-publish/artical-publish-center.vue'),
children:[
{ path: 'artical-publish-sub',
title: '管理员',
name: 'artical-publish-sub',
icon: 'person',
component: () => import('@/views/tables/exportable-table-JD.vue')
},
{ path: 'partInfo',
title: '部门信息',
name: 'partInfo',
icon: 'person-stalker',
component: () => import('@/views/form/work-flow/work-flow.vue')
}
]},
{ path: '',
title: '工单设置',
name: 'Worksheet',
icon: 'wrench',
component: () => import('@/views/form/work-flow/work-flow.vue')
}
]
},
涌现了bug,请写bug demo,题目重现了?!?题目也就处理啦。^_^