vuetify-material-dashboard
vuetify-material-dashboard copied to clipboard
Nested routes not working with router setup
Nested/children routes are not working with the current vue router setup, e.g.
{
path: '/user/:id',
view: 'User',
children: [
{
path: 'profile',
view: 'UserProfile'
}
]
},
children
option is being ignored by function route
.
how can solve this problem
@shijianzhong this is the fix:
https://github.com/travisbotello/vuetify-material-dashboard/commit/6e8484bb6b2cdd7682e7da9da413ef254e266dcd
@shijianzhong this is the fix:
Your approach doesn't work. Something missing... Router doesn't show child component.
Just tested it again on my local machine. For me it is working. What is the output of console.log
in line 49?
No errors in console. console.log(router) is printing VueRouter {} with everything inside...
Browser switch to /parent/child and i am expecting to see child component, but on screen is still parent component...
So inside VueRouter {}
you see the correct parent/child structure? If this is true, then you might have to adjust your templates. Because you also need nested <vue-router />
elements inside parent view to make nested routes working correctly. Example here: https://router.vuejs.org/guide/essentials/nested-routes.html
Ohhh yaeh :(
Sorry for this, forgot to put <router-view/>
Sorry for loosing your time and thanks for help :)
Have e great weekend :)