From 69cdd3134026e209bf4fcdfafe480536c2f22739 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Thu, 16 Jun 2022 18:07:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=8C=96=20=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/knockGold/index.jsx | 1 + src/components/knockGold/wangEditor.jsx | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/knockGold/index.jsx b/src/components/knockGold/index.jsx index e4ef4e61..7e121f79 100644 --- a/src/components/knockGold/index.jsx +++ b/src/components/knockGold/index.jsx @@ -1031,6 +1031,7 @@ export default class addKnockGold extends Component { }} width='520px' text={this.state.model.instruction} + limitLength={500} /> diff --git a/src/components/knockGold/wangEditor.jsx b/src/components/knockGold/wangEditor.jsx index 18fedcfa..0ff8cfb4 100644 --- a/src/components/knockGold/wangEditor.jsx +++ b/src/components/knockGold/wangEditor.jsx @@ -34,8 +34,8 @@ export default class wangeditor extends React.Component { //没有文字 self.props.setEdittext('') } - if (text.length > 500) { - let str = text.slice(0, 500) + if (text.length > self.props.limitLength) { + let str = text.slice(0, self.props.limitLength) self.setState({ editorHtml: str }) editor.txt.html(str) self.props.setEdittext(str) @@ -55,7 +55,9 @@ export default class wangeditor extends React.Component { return (
-

{this.state.count + '/' + 500}

+

+ {this.state.count + '/' + this.props.limitLength} +

) }