diff --git a/packages/utils/src/route.js b/packages/utils/src/route.js index f3de9ae83d..eaa31df804 100644 --- a/packages/utils/src/route.js +++ b/packages/utils/src/route.js @@ -54,6 +54,9 @@ function cleanChildrenRoutes (routes, isChild = false, routeNameSplitter = '-', routes.forEach((route) => { route.path = isChild ? route.path.replace('/', '') : route.path if (route.path.includes('?')) { + if (route.name.endsWith(`${routeNameSplitter}index`)) { + route.path = route.path.replace(/\?$/, '') + } const names = route.name.replace(regExpParentRouteName, '').split(routeNameSplitter) const paths = route.path.split('/') if (!isChild) {