diff --git a/packages/utils/src/route.js b/packages/utils/src/route.js index edc9616d6794..97d53ae1032d 100644 --- a/packages/utils/src/route.js +++ b/packages/utils/src/route.js @@ -56,7 +56,7 @@ function cleanChildrenRoutes (routes, isChild = false, routeNameSplitter = '-', route.path = isChild ? route.path.replace('/', '') : route.path if (route.path.includes('?')) { if (route.name.endsWith(`${routeNameSplitter}index`)) { - route.path = route.path.replace(/\?$/, '') + route.path = route.path.replace(/\?\/?$/, trailingSlash ? '/' : '') } const names = route.name.replace(regExpParentRouteName, '').split(routeNameSplitter) const paths = route.path.split('/')