浏览代码

富文本去除广告

jwyu 1 年之前
父节点
当前提交
93169cbf84
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      src/views/smartReport/components/TextEdit.vue

+ 7 - 2
src/views/smartReport/components/TextEdit.vue

@@ -89,14 +89,19 @@ export default {
                     //内容改变事件
                     contentChanged: function () {
                         that.lastEditRange = getSelection().getRangeAt(0) || 0;
-                        that.$emit('textChange', that.html)
+                        
+                        // that.$emit('textChange', that.html)
+                        that.sendHtml()
                     },
                 },
             }
         }
     },
     methods: {
-        
+        sendHtml(){
+            const str=this.html.replace(/<p data-f-id=\"pbf\".*?<\/p>/g, "")
+            this.$emit('textChange', str)
+        }
     },
     components:{}
 }