|
|
|
@ -219,6 +219,15 @@ class ChoquesEditor extends Component {
|
|
|
|
|
var texts;
|
|
|
|
|
const _text = quill.getText();
|
|
|
|
|
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.isNull(_text)===true){
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!reg.test(_text)) {
|
|
|
|
|
// 处理编辑器内容为空
|
|
|
|
|
try {
|
|
|
|
@ -266,11 +275,28 @@ class ChoquesEditor extends Component {
|
|
|
|
|
toShowMode = () => {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
isNull=( str )=>{
|
|
|
|
|
if ( str == "" ) return true;
|
|
|
|
|
var regu = "^[ ]+$";
|
|
|
|
|
var re = new RegExp(regu);
|
|
|
|
|
//为空或纯空格为 true 有值为false
|
|
|
|
|
console.log(re.test(str))
|
|
|
|
|
return re.test(str);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
onContentChange=(value,quill)=>{
|
|
|
|
|
// debugger
|
|
|
|
|
const _text = quill.getText();
|
|
|
|
|
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
|
|
|
|
|
|
|
|
|
|
if(this.isNull(_text)===true){
|
|
|
|
|
this.setState({
|
|
|
|
|
question_titleysl:""
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!reg.test(_text)) {
|
|
|
|
|
// 处理编辑器内容为空
|
|
|
|
|
try {
|
|
|
|
@ -294,6 +320,15 @@ class ChoquesEditor extends Component {
|
|
|
|
|
onContentChanges = (value, quill) => {
|
|
|
|
|
const _text = quill.getText();
|
|
|
|
|
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.isNull(_text)===true){
|
|
|
|
|
this.setState({
|
|
|
|
|
question_titlesysl:""
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!reg.test(_text)) {
|
|
|
|
|
// 处理编辑器内容为空
|
|
|
|
|
try {
|
|
|
|
|