From 73b2dc5000b03cd150d91e0f6f1d1e3ba82cc97f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 05 七月 2024 23:14:39 +0800 Subject: [PATCH] 2024-07-05 --- src/components/editor/index.jsx | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/editor/index.jsx b/src/components/editor/index.jsx index ede20dc..05a82fa 100644 --- a/src/components/editor/index.jsx +++ b/src/components/editor/index.jsx @@ -21,7 +21,7 @@ state = { editorState: '', - encryption: 'false', + encryption: 'false' } UNSAFE_componentWillMount () { @@ -51,6 +51,7 @@ encryption }) } + shouldComponentUpdate (nextProps, nextState) { return !is(fromJS(this.props), fromJS(nextProps)) } @@ -213,10 +214,16 @@ } render() { + const { config } = this.props const { editorState } = this.state + let style = null + if (config && config.contHeidht) { + style = {'--editor-height': config.contHeidht < 100 ? config.contHeidht + 'vh' : config.contHeidht + 'px'} + } + return ( - <div className="normal-braft-editor"> + <div className="normal-braft-editor" style={style}> <BraftEditor value={editorState} onChange={this.handleEditorChange} -- Gitblit v1.8.0