组件化 富文本
This commit is contained in:
parent
6518594631
commit
69cdd31340
|
@ -1031,6 +1031,7 @@ export default class addKnockGold extends Component {
|
||||||
}}
|
}}
|
||||||
width='520px'
|
width='520px'
|
||||||
text={this.state.model.instruction}
|
text={this.state.model.instruction}
|
||||||
|
limitLength={500}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
@ -34,8 +34,8 @@ export default class wangeditor extends React.Component {
|
||||||
//没有文字
|
//没有文字
|
||||||
self.props.setEdittext('')
|
self.props.setEdittext('')
|
||||||
}
|
}
|
||||||
if (text.length > 500) {
|
if (text.length > self.props.limitLength) {
|
||||||
let str = text.slice(0, 500)
|
let str = text.slice(0, self.props.limitLength)
|
||||||
self.setState({ editorHtml: str })
|
self.setState({ editorHtml: str })
|
||||||
editor.txt.html(str)
|
editor.txt.html(str)
|
||||||
self.props.setEdittext(str)
|
self.props.setEdittext(str)
|
||||||
|
@ -55,7 +55,9 @@ export default class wangeditor extends React.Component {
|
||||||
return (
|
return (
|
||||||
<div className='countBox_par'>
|
<div className='countBox_par'>
|
||||||
<div id='wangeditorDom' style={{ width: this.props.width }}></div>
|
<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>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue