diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js index 58ef7e5a9fab6e0f650488840811aa66f8bd6a75..4b2c1d45574f66eac47c640064894fd680054c7c 100644 --- a/src/layouts/BasicLayout.js +++ b/src/layouts/BasicLayout.js @@ -106,8 +106,15 @@ class BasicLayout extends React.PureComponent { }); } - componentDidUpdate() { + componentDidUpdate(preProps) { + // After changing to phone mode, + // if collapsed is true, you need to click twice to display this.breadcrumbNameMap = this.getBreadcrumbNameMap(); + const { isMobile } = this.state; + const { collapsed } = this.props; + if (isMobile && !preProps.isMobile && !collapsed) { + this.handleMenuCollapse(false); + } } componentWillUnmount() {