From 3ee45d4c86cfdadcd96a32a5c93efc8e4f52eda1 Mon Sep 17 00:00:00 2001 From: In Date: Mon, 21 Jan 2019 11:11:16 +0800 Subject: [PATCH] feat: Routing is in the root directory can also matchs. (#3364) --- src/components/SiderMenu/SiderMenuUtils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/SiderMenu/SiderMenuUtils.js b/src/components/SiderMenu/SiderMenuUtils.js index 6722ed7a..6e04ec13 100644 --- a/src/components/SiderMenu/SiderMenuUtils.js +++ b/src/components/SiderMenu/SiderMenuUtils.js @@ -35,5 +35,6 @@ export const getDefaultCollapsedSubMenus = props => { } = props; return urlToList(pathname) .map(item => getMenuMatches(flatMenuKeys, item)[0]) - .filter(item => item); + .filter(item => item) + .reduce((acc, curr) => [...acc, curr], ['/']); }; -- GitLab