Browse Source

🐛 site menu open bug

pull/13958/head
ycjcl868 6 years ago
committed by 偏右
parent
commit
1a0cea28a3
  1. 13
      site/theme/template/Content/MainContent.jsx

13
site/theme/template/Content/MainContent.jsx

@ -70,10 +70,13 @@ export default class MainContent extends React.PureComponent {
} }
static getDerivedStateFromProps(props, state) { static getDerivedStateFromProps(props, state) {
return { if (!state.openKeys) {
...state, return {
openKeys: getSideBarOpenKeys(props), ...state,
}; openKeys: getSideBarOpenKeys(props),
};
}
return null;
} }
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
@ -259,7 +262,7 @@ export default class MainContent extends React.PureComponent {
inlineIndent="40" inlineIndent="40"
className="aside-container menu-site" className="aside-container menu-site"
mode="inline" mode="inline"
defaultOpenKeys={openKeys} openKeys={openKeys}
selectedKeys={[activeMenuItem]} selectedKeys={[activeMenuItem]}
onOpenChange={this.handleMenuOpenChange} onOpenChange={this.handleMenuOpenChange}
> >

Loading…
Cancel
Save