optionnel route for parent

This commit is contained in:
Alexandre Chopin 2016-12-20 17:45:25 +01:00
parent 904c4e5793
commit 8ab7d4f0df

View File

@ -232,10 +232,10 @@ function cleanChildrenRoutes (routes, isChild = false) {
let isOptional = true
routes.forEach((route) => {
route.path = (isChild) ? route.path.replace('/', '') : route.path
if (route.path === '') {
if (route.path === '' || route.path === '/') {
isOptional = false
}
if (isChild && isOptional && route.path.includes(':')) {
if (isOptional && route.path.includes(':')) {
route.path += '?'
}
if (route.children) {