vue中获取文本框中的纯文本内容

加上正则表达式就行了,

this.commentContent是正常进行双向绑定的值
this.commentContent.replace(/<(style|script|iframe)[^>]*?>[sS]+?</1s*>/gi,'').replace(/<[^>]+?>/g,'').replace(/s+/g,' ').replace(/ /g,' ').replace(/>/g,' ')
原文地址:https://www.cnblogs.com/gfbzs/p/12447270.html