vue element 多級菜單 嵌套路由跳轉問題


1.在二級菜單加一個<router-view></router-view>標簽 (用來承載三級菜單頁面)

2.在項目路由中的meta標簽加一個參數開關來控制是否隱藏二級菜單頁面

  

 

  {
    path: '/structure',
    component: Layout,
    // redirect: '/permission/page',
    alwaysShow: true, // will always show the root menu
    name: 'Permission',
    meta: {
      title: 'structure',
      icon: 'blockchain',
      roles: ['admin'] // you can set roles in root nav
    },
    children: [
      // 1級頁面 構建列表頁
      {
        path: 'index',
        component: () => import('@/views/baas/chain'),
        name: 'Blockchain',
        meta: {
          title: 'blockchain',
          showRole: true
        },
        children: [
          //2級頁面 鏈詳情頁 通道
          {
            path: 'channel/:id(\\d+)',
            component: () => import('@/views/baas/channel'),
            name: 'Channel',
            meta: {
              title: 'channel',
              showRole: false,
              showRoles: true
            },
            hidden: true,
            children: [
              // 3級頁面 查看頁 鏈碼
              {
                path: 'chaincode/:ids(\\d+)',
                component: () => import('@/views/baas/chaincode'),
                name: 'Chaincode',
                meta: {
                  title: 'chaincode',
                  showRoles: false
                },
                hidden: true
              }
            ]
          },

        ]
      },
    ]
  }

  

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM