Answer the question
In order to leave comments, you need to log in
Why renders the top route component instead of the child?
I'm writing a VueJS front
Started nesting routes inside each other to work with breadcrumbs. As a result, for some reason, the same component of the main route is shown on all child routes. What am I doing wrong?)
Here is the same piece of the route
{
name: 'settings.segments.index',
path: '/settings-segments',
component: IndexSegmentComponent,
meta: {
breadcrumb: 'Сегменты'
},
children: [
{
path: '/settings-segments/create',
name: 'settings.segments.create',
component: CreateSegmentComponent,
meta: {
breadcrumb: 'Новый сегмент'
},
},
{
path: '/settings-segments/:id',
name: 'settings.segments.show',
component: ShowSegmentComponent,
meta: {
breadcrumb: 'Просмотр сегмента'
},
},
]
},
Answer the question
In order to leave comments, you need to log in
They probably forgot to add router-view to the IndexSegmentComponent.
UPD. Well, yes, it is. The dude was shy about something and rubbed the comment, but they (comments) are duplicated in the mail, so I restore:
Seriously. If you took the trouble to read the documentation , you would be aware that you should use separate router-view
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question