富文本限制一千字
This commit is contained in:
parent
458ac69a76
commit
8dc11c1311
|
@ -38,8 +38,8 @@ export default class wangeditor extends React.Component{
|
||||||
if(text.length==0){//没有文字
|
if(text.length==0){//没有文字
|
||||||
self.props.setEdittext("");
|
self.props.setEdittext("");
|
||||||
}
|
}
|
||||||
if(text.length>10){
|
if(text.length>1000){
|
||||||
let str = text.slice(0,10);
|
let str = text.slice(0,1000);
|
||||||
self.setState({editorHtml:str});
|
self.setState({editorHtml:str});
|
||||||
editor.txt.html(str)
|
editor.txt.html(str)
|
||||||
self.props.setEdittext(str);
|
self.props.setEdittext(str);
|
||||||
|
|
|
@ -35,8 +35,8 @@ export default class wangeditor extends React.Component{
|
||||||
if(text.length==0){//没有文字
|
if(text.length==0){//没有文字
|
||||||
self.props.setEdittext("");
|
self.props.setEdittext("");
|
||||||
}
|
}
|
||||||
if(text.length>10){
|
if(text.length>1000){
|
||||||
let str = text.slice(0,10);
|
let str = text.slice(0,1000);
|
||||||
self.setState({editorHtml:str});
|
self.setState({editorHtml:str});
|
||||||
editor.txt.html(str)
|
editor.txt.html(str)
|
||||||
self.props.setEdittext(str);
|
self.props.setEdittext(str);
|
||||||
|
|
Loading…
Reference in New Issue