From f0bf8c399c354c22227f8f1a76ed806098db59c0 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 21 五月 2024 16:51:02 +0800 Subject: [PATCH] 2024-05-21 --- src/menu/components/share/normalheader/index.jsx | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/menu/components/share/normalheader/index.jsx b/src/menu/components/share/normalheader/index.jsx index acc4e22..e0ed3f4 100644 --- a/src/menu/components/share/normalheader/index.jsx +++ b/src/menu/components/share/normalheader/index.jsx @@ -36,11 +36,22 @@ } getStyle = (style) => { - if (!style.borderBottomWidth) { - style.borderBottomWidth = '0px' + let _style = fromJS(style).toJS() + if (!_style.borderBottomWidth) { + _style.borderBottomWidth = '0px' + } + if (_style.fontFamily) { + if (_style.fontFamily.length === 0) { + delete _style.fontFamily + } else { + _style.fontFamily = _style.fontFamily.join(',') + } + } + if (_style.lineHeight === 2.8) { + delete _style.lineHeight } - let _config = {...this.props.config, headerStyle: style} + let _config = {...this.props.config, headerStyle: _style} this.props.updateComponent(_config) } @@ -48,9 +59,13 @@ changeStyle = () => { const { config } = this.props - let options = ['font', 'border', 'background', 'padding'] + let _style = config.headerStyle ? fromJS(config.headerStyle).toJS() : {} + let options = ['font', 'border', 'background', 'padding', 'fontFamily'] - MKEmitter.emit('changeStyle', options, config.headerStyle, this.getStyle) + _style.fontFamily = _style.fontFamily ? _style.fontFamily.split(',') : [] + _style.lineHeight = _style.lineHeight || 2.8 + + MKEmitter.emit('changeStyle', options, _style, this.getStyle) } render() { -- Gitblit v1.8.0