var str = 这里绑定富文本框的内容 ; str = this.delHtmlTag(str); var test = str test = test.replace(/ /ig, ""); if( test.trim() == null || test.trim() == '' || test.trim() == undefined ){ this.$message.error("不能输入全空格") return; } delHtmlTag(str){ return str.replace(/<[^>]+>/g,""); },