mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 06:05:11 +00:00
fix(vue-router): force chidren to be required if default child is present (#8394)
This commit is contained in:
parent
8e07cfc3b5
commit
7cac3c7fc9
@ -87,6 +87,13 @@ function cleanChildrenRoutes (routes, isChild = false, routeNameSplitter = '-',
|
||||
if (trailingSlash === false) {
|
||||
defaultChildRoute.name = route.name
|
||||
}
|
||||
route.children.forEach((child) => {
|
||||
if (child.path !== indexRoutePath) {
|
||||
const parts = child.path.split('/')
|
||||
parts[1] = parts[1].endsWith('?') ? parts[1].substr(0, parts[1].length - 1) : parts[1]
|
||||
child.path = parts.join('/')
|
||||
}
|
||||
})
|
||||
delete route.name
|
||||
}
|
||||
route.children = cleanChildrenRoutes(route.children, true, routeNameSplitter, trailingSlash, routeName)
|
||||
|
Loading…
Reference in New Issue
Block a user