From 347ca2d72cd044484e566056fb71ae3e0cdbfd19 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 15 十一月 2022 11:21:51 +0800 Subject: [PATCH] 2022-11-15 --- src/menu/components/carousel/data-card/index.jsx | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/menu/components/carousel/data-card/index.jsx b/src/menu/components/carousel/data-card/index.jsx index b83ab21..dceb119 100644 --- a/src/menu/components/carousel/data-card/index.jsx +++ b/src/menu/components/carousel/data-card/index.jsx @@ -49,7 +49,7 @@ subtype: card.subtype, setting: { interType: 'system' }, wrap: { name: card.name, width: card.width || 24, autoplay: 'false', dots: 'true', height: '300px' }, - style: { borderWidth: '1px', borderColor: '#e8e8e8', marginTop: '8px', marginBottom: '8px', height: '300px' }, + style: { borderWidth: '1px', borderColor: '#e8e8e8', marginTop: '8px', marginBottom: '8px' }, columns: [], scripts: [], subcards: [{ @@ -85,8 +85,15 @@ this.updateComponent(_card) } else { + let _card = fromJS(card).toJS() + + if (!_card.wrap.height && _card.style.height) { // 鍏煎 + _card.wrap.height = _card.style.height + } + delete _card.style.height + this.setState({ - card: fromJS(card).toJS() + card: _card }) } } @@ -208,13 +215,11 @@ getWrapForms = () => { const { card } = this.state - return getWrapForm({...card.wrap, height: card.style.height}, card.subtype) + return getWrapForm(card.wrap, card.subtype) } updateWrap = (res) => { let _card = {...this.state.card, wrap: res} - - // _card.style.height = res.height if (res.title && !_card.headerStyle) { _card.headerStyle = { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: '#e8e8e8' } @@ -239,7 +244,6 @@ render() { const { card } = this.state let _style = resetStyle(card.style) - _style.height = 'auto' return ( <div className="menu-data-carousel-edit-box" style={_style} onClick={this.clickComponent} id={card.uuid}> -- Gitblit v1.8.0