const router =new VueRouter(
{
routes:[
    {path:'/HelloWord',component: HelloWord,
    children:[
      {path:'/a',component: () => import('./a.vue')},
      {path:'/b',component: () => import('./b.vue')}
        ]}
    ],
mode:"history"
})
 
在HelloWord.vue文件里面也加上
<router-view></router-view>
那么在访问 /a 路径的时候 会把a.vue的内容在 HelloWord.vue里面加载 
 
 
后计:
其实嵌套后就是让跳转出来的组件在自己的页面上展示
比如导航页面HelloWord.vue 
路由嵌套

 

 

 

相关文章:

  • 2021-04-28
  • 2021-07-30
  • 2021-12-17
  • 2022-02-10
  • 2021-12-09
  • 2021-05-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-19
  • 2022-12-23
  • 2022-01-16
  • 2021-07-09
  • 2022-12-23
  • 2021-10-05
  • 2021-04-29
相关资源
相似解决方案