Skip to content

我有一个多级路由显示在面包屑的需求 #2016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1020431880 opened this issue May 6, 2019 · 1 comment
Open

我有一个多级路由显示在面包屑的需求 #2016

1020431880 opened this issue May 6, 2019 · 1 comment

Comments

@1020431880
Copy link

1020431880 commented May 6, 2019

现在有三级路由:

  routes: [{
    path: '/role',
    component: Layout,
    meta: { title: '角色管理' },
    children: [{
      path: 'role-manage',
      component: () => import('@/views/roleManage.vue'),
      meta: { title: '角色管理' },
      children: [{
          path: 'role-edit',
          component: () => import('@/views/roleEdit.vue'),
          meta: { title: '角色编辑' },
        },
        {
          path: 'role-detail',
          component: () => import('@/views/roleDetail.vue'),
          meta: { title: '角色详情' },
        }
      ]
    }]
  }]

预期实现:要求配置的role-edit不会在菜单里显示为role-manage的二级菜单,是通过点击role-manage的页面的【详情按钮】来跳转到配置的子路由role-edit页面,并且面包屑显示 【角色管理/角色编辑】,地址显示:【http://localhost:8080/#/role/role-manage/role-edit】。

实际以上配置后的效果:面包屑导航会显示 【角色管理/角色编辑】,地址栏也可以这样拼起来,但是实际在role-manage页面点击【详情按钮】跳转完之后还是在role-manage页面,而没有进入到配置的child的role-edit路由页面,除非在role-manage的页面中加一个,才会在当前的role-manage页面中一起显示role-edit的页面,想要实现预期的效果,有什么办法通过配置实现吗,

@PanJiaChen
Copy link
Owner

role-manage 加上 redirect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants