本文共 817 字,大约阅读时间需要 2 分钟。
{ path: '/home', component: () => import('../views/home/home.vue'), children: [ { path: '', name: 'home', component: () => import('../views/home/home.vue'), }, { path: 'sub', name: 'homeSub', component: () => import('../views/home/subpage.vue') } ] },
问题描述:在项目中使用路由父子是嵌套时,路由不显示页面问题,
1、在父路由得对象里里写入
component: { render: (e) => e("router-view")},
2、父页面的在vue页面中加入
路由代码:
{ path: '/home', component: { render: (e) => e("router-view")}, children: [ { path: '', name: 'home', component: () => import('../views/home/home.vue'), }, { path: 'sub', name: 'homeSub', component: () => import('../views/home/subpage.vue') } ] },
3、完美解决,撒花❀❀❀❀❀
转载地址:http://kixxi.baihongyu.com/