使用vue-element-admin框架时如何添加多级目录

一、添加三层路由

{
    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

/****************************我是可爱的分割线********************************/

原文地址:https://www.cnblogs.com/merryan-share/p/13840607.html