美文网首页
嵌套路由

嵌套路由

作者: 混吃等死小前端 | 来源:发表于2020-03-12 16:46 被阅读0次
const routes = [
  {
    path: '/about',
    name: 'About',
    component: () => import('../views/About.vue'),
    //嵌套开始
    children: [
      {
        path: 'child', //注意!!此处不需要加 /
        name: 'child',
        component: () => import('../views/AboutChild.vue'),
      }
    ]
    //嵌套结束
  }
]

以 / 开头的嵌套路径会被当作根路径

相关文章

网友评论

      本文标题:嵌套路由

      本文链接:https://www.haomeiwen.com/subject/rpcmjhtx.html