From 8ab7d4f0dfbdc1f1bb51d8a9c804050b7bb35e7d Mon Sep 17 00:00:00 2001 From: Alexandre Chopin Date: Tue, 20 Dec 2016 17:45:25 +0100 Subject: [PATCH] optionnel route for parent --- lib/build/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/build/index.js b/lib/build/index.js index 80cb7c37d0..20e7bf14a8 100644 --- a/lib/build/index.js +++ b/lib/build/index.js @@ -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) {