mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-06 21:10:38 +00:00
optionnel route for parent
This commit is contained in:
parent
904c4e5793
commit
8ab7d4f0df
@ -232,10 +232,10 @@ function cleanChildrenRoutes (routes, isChild = false) {
|
||||
let isOptional = true
|
||||
routes.forEach((route) => {
|
||||
route.path = (isChild) ? route.path.replace('/', '') : route.path
|
||||
if (route.path === '') {
|
||||
if (route.path === '' || route.path === '/') {
|
||||
isOptional = false
|
||||
}
|
||||
if (isChild && isOptional && route.path.includes(':')) {
|
||||
if (isOptional && route.path.includes(':')) {
|
||||
route.path += '?'
|
||||
}
|
||||
if (route.children) {
|
||||
|
Loading…
Reference in New Issue
Block a user