From f3167f8371d19d0ea8fe7d0e7af5517ff0b08cd2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 07 四月 2021 23:25:29 +0800 Subject: [PATCH] 2021-04-07 --- src/menu/stylecontroller/index.jsx | 24 ++++++++++++++++++++++-- 1 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/menu/stylecontroller/index.jsx b/src/menu/stylecontroller/index.jsx index ee460b5..595e8ff 100644 --- a/src/menu/stylecontroller/index.jsx +++ b/src/menu/stylecontroller/index.jsx @@ -22,7 +22,7 @@ } state = { - dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, + dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, card: null, comIds: [], backgroundImage: '', @@ -268,6 +268,15 @@ this.updateStyle(_style) } + changeWidth = (val) => { + let _val = val + if (_val === '0px') { + _val = 'auto' + } + + this.updateStyle({width: _val}) + } + changeHeight = (val) => { let _val = val if (_val === '0px') { @@ -313,6 +322,17 @@ <div className="menu-style-controller"> <Form {...formItemLayout}> {card ? <Collapse expandIconPosition="right" destroyInactivePanel={true} defaultActiveKey={options[0]}> + {options.includes('width') ? <Panel header="瀹藉害" key="width"> + <Col span={24}> + <Form.Item + colon={false} + label={<Icon title="瀹藉害" type="column-width" />} + 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}/> + </Form.Item> + </Col> + </Panel> : null} {options.includes('height') ? <Panel header="楂樺害" key="height"> <Col span={24}> <Form.Item @@ -320,7 +340,7 @@ label={<Icon title="楂樺害" type="column-height" />} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - <StyleInput defaultValue={card.height || ''} options={['px']} onChange={this.changeHeight}/> + <StyleInput defaultValue={card.height || ''} options={['px', 'vh', 'vw']} onChange={this.changeHeight}/> </Form.Item> </Col> </Panel> : null} -- Gitblit v1.8.0