vue中获取文本框中的纯文本内容
时间:2020-03-09 10:59:31
收藏:0
阅读:632
加上正则表达式就行了,
this.commentContent是正常进行双向绑定的值
this.commentContent.replace(/<(style|script|iframe)[^>]*?>[\s\S]+?<\/\1\s*>/gi,‘‘).replace(/<[^>]+?>/g,‘‘).replace(/\s+/g,‘ ‘).replace(/ /g,‘ ‘).replace(/>/g,‘ ‘)
原文:https://www.cnblogs.com/gfbzs/p/12447270.html
评论(0)