侧边菜单栏采用了element ui  的el-menu组件,用到了default-active和router属性

记录 D2-admin 侧边栏 二级路由高亮问题

分三步走

第一步,在el-menu 中添加router='true' 和 default-active = { this.$route.meta.name } 属性

        --this.$route.meta.name 为路由表中配置

 

第二步, 在el-menu-item 中 添加 router = { menu.path }

 

第三步, 在路由表中添加自定义属性meta.name 的值

       -- 例如 

                  path: '/',

                  component:  '........',

                  children: [

                        { path: 'index', component: '..........', meta: { title: '首页', auth: true, name: '/index' } }   

                  ]

                    

记录 D2-admin 侧边栏 二级路由高亮问题

搞定收工

相关文章:

  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2021-10-03
猜你喜欢
  • 2021-04-28
  • 2021-12-14
  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
  • 2022-01-03
相关资源
相似解决方案