fix route optional

This commit is contained in:
Alexandre Chopin 2017-02-08 20:13:03 +01:00
parent f490786fa3
commit 51da5569f8

View File

@ -292,7 +292,7 @@ function cleanChildrenRoutes (routes, isChild = false) {
if (/-index$/.test(route.name)) {
parents.push(route.name)
} else {
if (parents.indexOf(route.name.split('-').slice(0, -1).join('-') + '-index') > -1) {
if (hasIndex && parents.indexOf(route.name.split('-').slice(0, -1).join('-') + '-index') > -1) {
route.path = route.path.replace('?', '')
}
}