mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
fix(utils): remove optional params in routes ending with index
(#7845)
This commit is contained in:
parent
ec534d05b9
commit
2eb42876a2
@ -54,6 +54,9 @@ function cleanChildrenRoutes (routes, isChild = false, routeNameSplitter = '-',
|
|||||||
routes.forEach((route) => {
|
routes.forEach((route) => {
|
||||||
route.path = isChild ? route.path.replace('/', '') : route.path
|
route.path = isChild ? route.path.replace('/', '') : route.path
|
||||||
if (route.path.includes('?')) {
|
if (route.path.includes('?')) {
|
||||||
|
if (route.name.endsWith(`${routeNameSplitter}index`)) {
|
||||||
|
route.path = route.path.replace(/\?$/, '')
|
||||||
|
}
|
||||||
const names = route.name.replace(regExpParentRouteName, '').split(routeNameSplitter)
|
const names = route.name.replace(regExpParentRouteName, '').split(routeNameSplitter)
|
||||||
const paths = route.path.split('/')
|
const paths = route.path.split('/')
|
||||||
if (!isChild) {
|
if (!isChild) {
|
||||||
|
Loading…
Reference in New Issue
Block a user