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} +

) }