一个菜单两个二级路由的搭建

效果如下,而且这是最上方的菜单,需要进入以后重定向。

TypeScript 复制代码
  {
    path: '/',
    name: 'HOME',
    component: ConsoleLayout, //这里也有router-view
    meta: {
      menu: false
    },
    redirect: {
      name: 'ManagerList'
    },
    children: [
      {
        path: '/rightsManage',
        name: 'RightsManage',
        component: () => import('@/views/AdminConsole/rightsManage/index.vue'),
        meta: {
          menu: true,
          title: '权限管理'
        },
        children: [
              {
              path: '/managerList',
              name: 'ManagerList',
              component: () => import('@/views/AdminConsole/rightsManage/manager.vue'),
              meta:
               {
                menu: true,
                title: '管理员列表'
               }
              },
              {
                path: '/operationLogs',
                name: 'OperationLogs',
                component: () => import('@/views/AdminConsole/rightsManage/operationLogs.vue'),
                meta:
                 {
                  menu: true,
                  title: '操作日志'
                 }
              },
           ]
        }
     ]
  },

注意,这里需要children里套children,index.vue里面的内容如下,需要给路由一个入口。

html 复制代码
<script setup lang="ts"></script>
<template>
  <router-view></router-view>
</template>
相关推荐
JIngJaneIL3 小时前
基于java + vue校园跑腿便利平台系统(源码+数据库+文档)
java·开发语言·前端·数据库·vue.js·spring boot
前端要努力3 小时前
月哥创业3年,还活着!
前端·面试·全栈
sao.hk3 小时前
ubuntu2404安装k3s
前端·chrome
cos3 小时前
Worktrunk 完全指南:让 Git Worktree 和 Claude Code 和平共处
前端·ai编程·claude
不哦罗密经3 小时前
python相关
服务器·前端·python
ji_shuke3 小时前
opencv-mobile 和 ncnn-android 环境配置
android·前端·javascript·人工智能·opencv
神说要有光_zy3 小时前
极其矛盾又顺其自然的2025
前端
前端程序猿之路4 小时前
基于扣子(Coze)工作流 API 的微信小程序开发实践总结
前端·微信小程序·小程序·大模型·api·ai编程·扣子
bjzhang754 小时前
使用 HTML + JavaScript 实现积分抽奖系统
前端·javascript·html
京东零售技术4 小时前
2025京东零售技术年度精选 | 技术干货篇(内含福利)
前端·javascript·后端