From 41c55c1f103658b997f7a828a7067bdb228f1df0 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 04 十月 2022 23:35:10 +0800 Subject: [PATCH] 2022-10-04 --- src/mob/components/menubar/common-menubar/index.jsx | 16 ++++------------ 1 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/mob/components/menubar/common-menubar/index.jsx b/src/mob/components/menubar/common-menubar/index.jsx index 479cbf5..0c8e7d0 100644 --- a/src/mob/components/menubar/common-menubar/index.jsx +++ b/src/mob/components/menubar/common-menubar/index.jsx @@ -71,10 +71,6 @@ } } - componentDidMount () { - MKEmitter.addListener('submitStyle', this.getStyle) - } - shouldComponentUpdate (nextProps, nextState) { return !is(fromJS(this.state), fromJS(nextState)) } @@ -86,7 +82,6 @@ this.setState = () => { return } - MKEmitter.removeListener('submitStyle', this.getStyle) } /** @@ -106,15 +101,11 @@ changeStyle = () => { const { card } = this.state - MKEmitter.emit('changeStyle', [card.uuid], ['background', 'border', 'padding', 'margin', 'shadow'], card.style) + MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow'], card.style, this.getStyle) } - getStyle = (comIds, style) => { - const { card } = this.state - - if (comIds.length !== 1 || comIds[0] !== card.uuid) return - - let _card = {...card, style} + getStyle = (style) => { + let _card = {...this.state.card, style} this.setState({ card: _card @@ -182,6 +173,7 @@ </div> </Col> </div> + <div className="component-name"><div className="center">{card.name}</div></div> </div> ) } -- Gitblit v1.8.0