一、添加三層路由
{ path: '/system',//一級 component: Layout, meta: { title: '系統管理', icon: 'guide' }, children: [ { path: '/authManage',//二級 component: () => import('@/views/system/authManage/index'), redirect: 'noRedirect', meta: { title: '權限管理', icon: 'point' }, children: [ { path: 'roleAuth',//三級 name: 'roleAuth', component: () => import('@/views/system/authManage/roleAuth'), meta: { title: '角色權限管理', icon: 'point' } }, { path: 'orgAuth',// 三級 name: 'orgAuth', component: () => import('@/views/system/authManage/orgAuth'), meta: { title: '部門權限管理', icon: 'point' } } ] } ] }
二、在二級目錄下添加index.vue
<template> <router-view /> </template>
如圖所示:
以上就是vue-element-admin框架添加多級目錄的方法分享。
轉載請注明地址:https://www.cnblogs.com/merryan-share/p/13840607.html
/****************************我是可愛的分割線********************************/