vue路由篇(动态路由、路由嵌套)----动态路由下再嵌套子路由

https://blog.csdn.net/weixin_34174132/article/details/88678882

vue父路由默认选中第一个子路由,切换子路由让父路由高亮不会消失https://www.cnblogs.com/mmzuo-798/p/9492659.html

 

https://blog.csdn.net/qq_40666620/article/details/100576187(参考)

 

https://www.pianshen.com/article/4271213309/

 

 

 

 前面不写'/',它会自动找到上级,所有写成'b/c'就可以了,不需要嵌套前面的路由

 参考:

{
    path: '/device',
    name: 'device',
    // redirect: '/location/location/1',
    meta: {
      title: () => i18n.t('routes.device'),
      icon: 'device'
    },
    component: () => import('@/views/Location/index'),
    children: [
      {
        path: '/locationdetail/:id',
        name: 'locationdetail',
        redirect: '/locationdetail/:id/summary',
        component: () => import('@/views/Location/Location/Detail'),
        meta: {
          titile: 'Location Detail'
        },
        children: [
          {
            path: 'summary',
            name: 'summary',
            component: () => import('@/views/Location/Location/Summary')
          },
          {
            path: 'statistics',
            name: 'statistics',
            component: () => import('@/views/Location/Location/Statistics')
          }
        ]
      },
      {
        path: '/readerdetail/:id',
        name: 'readerdetail',
        redirect: '/readerdetail/:id/summary',
        component: () => import('@/views/Reader/Index'),
        meta: {
          titile: 'Location Detail'
        },
        children: [
          {
            path: 'summary',
            name: 'summary',
            component: () => import('@/views/Reader/Reader/Summary')
          }
        ]
      }
    ]
  },

 

 

 

posted @ 2020-07-22 10:42  haha-uu  阅读(2573)  评论(0编辑  收藏  举报