iview-admin 三级菜单路由

在iview-admin项目中遇到三级菜单的问题,参考文章https://segmentfault.com/a/1190000013555613
解决办法是增加一个中间层作为二级路由的component选项,项目中目录如下:
在这里插入图片描述
路由配置如下:

{
    path: '/otherBusiness',
    name: 'otherBusiness',
    meta: {
      icon: 'clipboard',
      title: '其他管理'
    },
    component: Main,
    children: [
      {
        path: '/otherBusiness/patent',
        name: 'patent',
        meta: {
          icon: 'clipboard',
          title: 'zl管理'
        },
        component: () => import('@/view/components/otherBusiness/artical-publish-center.vue'),
        children: [
          {
            path: 'patentList',
            name: 'patentList',
            meta: {
              icon: 'document-text',
              title: 'zl列表'
            },
            component: () => import('@/view/components/otherBusiness/PatentList.vue')
          },
          {
            path: 'noticeUpload',
            name: 'noticeUpload',
            meta: {
              icon: 'document-text',
              title: '通知书上传'
            },
            component: () => import('@/view/components/otherBusiness/NoticeUpload.vue')
          },
        ]
      },
    ]
  },

这样就可以实现了:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_45629194/article/details/100770975