|
@ -70,11 +70,14 @@ export default class MainContent extends React.PureComponent { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static getDerivedStateFromProps(props, state) { |
|
|
static getDerivedStateFromProps(props, state) { |
|
|
|
|
|
if (!state.openKeys) { |
|
|
return { |
|
|
return { |
|
|
...state, |
|
|
...state, |
|
|
openKeys: getSideBarOpenKeys(props), |
|
|
openKeys: getSideBarOpenKeys(props), |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps) { |
|
|
componentDidUpdate(prevProps) { |
|
|
const { location } = this.props; |
|
|
const { location } = this.props; |
|
@ -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} |
|
|
> |
|
|
> |
|
|