|
|
|
@ -229,6 +229,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 {
|
|
|
|
@ -276,11 +285,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 {
|
|
|
|
@ -304,6 +330,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 {
|
|
|
|
|