fix dynamic route optional

This commit is contained in:
Alexandre Chopin 2017-01-11 15:03:42 +01:00
parent 1a4822e38d
commit c77fc45d9b

View File

@ -252,7 +252,10 @@ function cleanChildrenRoutes (routes, isChild = false) {
if ((isChild && /-index$/.test(route.name)) || (!isChild && route.name === 'index')) {
hasIndex = true
}
route.path = (hasIndex) ? route.path.replace('?', '') : route.path
let names = route.path.split('/')
if (hasIndex && (isChild || (!isChild && names[1] && names[1].indexOf('?') > -1))) {
route.path = route.path.replace('?', '')
}
if (/-index$/.test(route.name)) {
parents.push(route.name)
} else {