let blank =
this.inputmsg.split(' ').every(n => {
return /^( )+$/.test(n); // 针对空格为 的情况
}) || this.inputmsg.trim().length === 0; // 普通空格的情况
if (blank) {
this.tips = '内容不能为空';
return;
}
原文链接:https://blog.csdn.net/qq_35649079/article/details/84138634
网友评论