routes: [
{ path: '/toOne/:id', name: 'toOneName', component: one,
children: [
{path: '/profile', component: oneNext},
{path: '/posts', component: twoNext}
]
}
]
我要在children通过动态路由的方式添加一个子路由,如何操作
{path: '/gets', component: threeNext}
this.$router.addRoutes()
这么写就好了
routers 是生成后的路由, data 是后端返回的路由数据 tree , lazyLoading 是懒加载路由