组件化 富文本

This commit is contained in:
wangsongsole 2022-06-16 18:07:07 +08:00
parent 6518594631
commit 69cdd31340
2 changed files with 6 additions and 3 deletions

View File

@ -1031,6 +1031,7 @@ export default class addKnockGold extends Component {
}}
width='520px'
text={this.state.model.instruction}
limitLength={500}
/>
</FormItem>
</Form>

View File

@ -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 (
<div className='countBox_par'>
<div id='wangeditorDom' style={{ width: this.props.width }}></div>
<p className='countBox'>{this.state.count + '/' + 500}</p>
<p className='countBox'>
{this.state.count + '/' + this.props.limitLength}
</p>
</div>
)
}