From 0aa70e32514bb74a478ce74757031b2a6b4612c1 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 26 Oct 2017 10:49:21 +0800 Subject: [PATCH] Fix home page collapsed menu --- src/layouts/BasicLayout.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js index 4da41ac0..17bace81 100644 --- a/src/layouts/BasicLayout.js +++ b/src/layouts/BasicLayout.js @@ -58,6 +58,9 @@ class BasicLayout extends React.PureComponent { getDefaultCollapsedSubMenus(props) { const currentMenuSelectedKeys = [...this.getCurrentMenuSelectedKeys(props)]; currentMenuSelectedKeys.splice(-1, 1); + if (currentMenuSelectedKeys.length === 0) { + return ['dashboard']; + } return currentMenuSelectedKeys; } getCurrentMenuSelectedKeys(props) { -- GitLab