Skip to content

Commit

Permalink
fix(utils): trailingSlash causes error with dynamic nuxt-child rout…
Browse files Browse the repository at this point in the history
…es (#9505)
  • Loading branch information
ms-fadaei committed Jul 1, 2021
1 parent 0742f59 commit 20f481f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/utils/src/route.js
Expand Up @@ -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('/')
Expand Down

0 comments on commit 20f481f

Please sign in to comment.