From dce3eca3dc273be7a5bd66094b840bb6c4f763c0 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 21 十一月 2021 14:09:44 +0800 Subject: [PATCH] 2021-11-21 --- src/templates/sharecomponent/columncomponent/index.jsx | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/src/templates/sharecomponent/columncomponent/index.jsx b/src/templates/sharecomponent/columncomponent/index.jsx index 357dfd8..ac3da97 100644 --- a/src/templates/sharecomponent/columncomponent/index.jsx +++ b/src/templates/sharecomponent/columncomponent/index.jsx @@ -469,11 +469,18 @@ }) } + revert = () => { + this.setState({ + columnlist: fromJS(this.props.config.columns).toJS() + }) + } + shouldComponentUpdate (nextProps, nextState) { return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) } componentDidMount () { + MKEmitter.addListener('revert', this.revert) MKEmitter.addListener('plusColumns', this.plusColumns) } @@ -484,6 +491,7 @@ this.setState = () => { return } + MKEmitter.removeListener('revert', this.revert) MKEmitter.removeListener('plusColumns', this.plusColumns) } -- Gitblit v1.8.0