From 71fce3cc19f80a6e0eba36cfc5e67995ee9712ff Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 23 七月 2020 09:23:59 +0800 Subject: [PATCH] 2020-07-23 --- src/templates/sharecomponent/cardcomponent/index.jsx | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/templates/sharecomponent/cardcomponent/index.jsx b/src/templates/sharecomponent/cardcomponent/index.jsx index 92149c9..350c9f5 100644 --- a/src/templates/sharecomponent/cardcomponent/index.jsx +++ b/src/templates/sharecomponent/cardcomponent/index.jsx @@ -38,7 +38,7 @@ UNSAFE_componentWillReceiveProps (nextProps) { if (!is(fromJS(this.props.card), fromJS(nextProps.card))) { setTimeout(() => { - if (nextProps.card.insert === 'true' && this.cardRef) { + if (nextProps.card.extraAction && this.cardRef) { if (this.cardRef.offsetWidth !== this.state.cardwidth || this.cardRef.offsetHeight !== this.state.cardheight) { this.setState({ cardwidth: this.cardRef.offsetWidth, @@ -311,7 +311,7 @@ componentDidMount() { const { card } = this.props - if (card.insert === 'true' && this.cardRef) { + if (card.extraAction && this.cardRef) { this.setState({ cardwidth: this.cardRef.offsetWidth, cardheight: this.cardRef.offsetHeight @@ -322,7 +322,7 @@ componentDidUpdate() { const { card } = this.props - if (card.insert === 'true' && this.cardRef) { + if (card.extraAction && this.cardRef) { if (this.cardRef.offsetWidth !== this.state.cardwidth || this.cardRef.offsetHeight !== this.state.cardheight) { this.setState({ cardwidth: this.cardRef.offsetWidth, @@ -437,7 +437,7 @@ </ul> : null } </div> - {card.insert === 'true' ? + {card.extraAction ? <div className={'ant-card chart-card chart-card-insert' + outclass} style={{ width: cardwidth, height: cardheight }} > <Icon type="plus" style={cardwidth > cardheight ? {fontSize: cardheight / 2 + 'px', lineHeight: cardheight + 'px'} : {fontSize: cardwidth / 2 + 'px', lineHeight: cardheight + 'px'}} /> </div> : null -- Gitblit v1.8.0