From 61ab22d7b6be46c00e8813b00b2352a52cc252f3 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 01 二月 2023 15:43:35 +0800 Subject: [PATCH] 2023-02-01 --- src/menu/stylecontroller/index.jsx | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/menu/stylecontroller/index.jsx b/src/menu/stylecontroller/index.jsx index 4da5969..397fa05 100644 --- a/src/menu/stylecontroller/index.jsx +++ b/src/menu/stylecontroller/index.jsx @@ -435,12 +435,20 @@ } changeWidth = (val) => { - let _val = val - if (_val === '0px') { - _val = 'auto' + const { card } = this.state + let _style = {...card} + + if (val === '0px') { + delete _style.width + } else { + _style.width = val } - this.updateStyle({width: _val}) + this.setState({ + card: _style + }) + + this.callback && this.callback(_style) } changeHeight = (val) => { @@ -495,7 +503,7 @@ label={<ColumnWidthOutlined title="瀹藉害"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - <StyleInput defaultValue={card.width || ''} options={['px', 'vh', 'vw', '%']} onChange={this.changeWidth}/> + <StyleInput defaultValue={card.width || ''} options={['px', 'vh', 'vw', '%', 'auto']} onChange={this.changeWidth}/> </Form.Item> </Col> </Panel> : null} -- Gitblit v1.8.0