Answer the question
In order to leave comments, you need to log in
How to make default page in VueJS child routes?
There is such a section of the personal account:
{
path: 'settings',
component: Settings,
children: [
{
path: 'personal',
component: Personal,
name: 'personal',
},
{
path: 'security',
component: Security,
name: 'security',
},
{
path: 'platforms',
component: Platforms,
name: 'platforms',
},
{
path: 'preference',
component: Preference,
name: 'preference',
},
]
}
<router-link :to="{name: 'personal'}">
Answer the question
In order to leave comments, you need to log in
In the general route, you need to specify the propertyredirect: { name: 'personal' }
It works for me like this:
{
path: '/document',
component: { template: '<router-view></router-view>' },
meta: { title: 'Документация' },
children: [
{
name: 'document-index',
path: '',
component: DocumentIndex,
meta: { title: 'Вся документация' },
},
{
name: 'document-create',
path: 'create',
component: DocumentCreate,
meta: { title: 'Добавить документ' },
},
{
name: 'document-update',
path: 'update/:id',
component: DocumentUpdate,
meta: { title: 'Редактировать документ' },
},
],
},
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question