diff --git a/src/components/SettingDrawer/index.js b/src/components/SettingDrawer/index.js index 10e989ed58ed0a7e3a1ea2c893206cdd04c468c7..8eabe5528a4f729b9ce44de38fbb3c5755509d5b 100644 --- a/src/components/SettingDrawer/index.js +++ b/src/components/SettingDrawer/index.js @@ -21,6 +21,10 @@ const Body = ({ children, title, style }) => ( @connect(({ setting }) => ({ setting })) class SettingDrawer extends PureComponent { + state = { + collapse: false, + }; + getLayOutSetting = () => { const { setting: { grid, fixedHeader, layout, autoHideHeader, fixSiderbar }, @@ -98,13 +102,14 @@ class SettingDrawer extends PureComponent { }; togglerContent = () => { - const { setting } = this.props; - this.changeSetting('collapse', !setting.collapse); + const { collapse } = this.state; + this.setState({ collapse: !collapse }); }; render() { const { setting } = this.props; - const { collapse, navTheme, primaryColor, layout, colorWeak } = setting; + const { navTheme, primaryColor, layout, colorWeak } = setting; + const { collapse } = this.state; return (