我有一些嵌套的路由,只是没有做应有的操作,
我正在尝试实现的路径:用户(工作正常),然后路径:用户/创建(不累加)
routes: [
{ path: '/dashboard', component: require('./views/DashboardComponent.vue').default},
{ path: '/profile', component: require('./views/profile/ProfileComponent.vue').default},
{ path: '/users', component: require('./views/user/UsersComponent.vue').default,
children: [
{ path: 'create', component: require('./views/user/CreateUserComponent.vue').default},
{ path: 'edit/:id', component: require('./views/user/CreateUserComponent.vue').default},
{ path: 'details/:id', component: require('./views/user/ShowUserComponent.vue').default}
]
},
...
正在发生的事情是,用户路径可以正常运行,但其他所有子路径却无法正常运行,当我按下链接时,应该将我带到路径:users / create,它再次显示相同的usersComponent,只是没有用户的形象。我没有任何错误。
如果我删除嵌套的子级,然后让它们自己留着,效果很好,但我没有嵌套的子级。
{ path: '/users', component: require('./views/user/UsersComponent.vue').default}
{ path: '/create', component: require('./views/user/CreateUserComponent.vue').default},
{ path: '/edit/:id', component: require('./views/user/CreateUserComponent.vue').default},
{ path: '/details/:id', component: require('./views/user/ShowUserComponent.vue').default}