From 766653ee7ac800187a070be4671b332bef0e87f1 Mon Sep 17 00:00:00 2001 From: zuiidea Date: Mon, 30 Oct 2017 11:49:27 +0800 Subject: [PATCH] merge #640 --- src/components/Layout/Bread.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/Layout/Bread.js b/src/components/Layout/Bread.js index 5a69607..5ce0a9f 100644 --- a/src/components/Layout/Bread.js +++ b/src/components/Layout/Bread.js @@ -40,13 +40,11 @@ const Bread = ({ menu, location }) => { let keys = [] let values = pathToRegexp(current.route, keys).exec(location.pathname.replace('#', '')) - - if (keys && values && (keys.length + 1) === values.length) { + if (keys.length) { keys.forEach((currentValue, index) => { if (typeof currentValue.name !== 'string') { return } - paramMap[currentValue.name] = values[index + 1] }) } @@ -62,7 +60,7 @@ const Bread = ({ menu, location }) => { return ( {((pathArray.length - 1) !== key) - ? + ? {content} : content}