diff --git a/lib/build/index.js b/lib/build/index.js index cafb08514d..56c6a5aa16 100644 --- a/lib/build/index.js +++ b/lib/build/index.js @@ -262,7 +262,9 @@ function cleanChildrenRoutes (routes, isChild = false) { } route.name = route.name.replace(/-index$/, '') if (route.children) { - delete route.name + if (route.children.find((child) => child.path === '')) { + delete route.name + } route.children = cleanChildrenRoutes(route.children, true) } })