Răsfoiți Sursa

富文本去除广告

jwyu 1 an în urmă
părinte
comite
93169cbf84
1 a modificat fișierele cu 7 adăugiri și 2 ștergeri
  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:{}
 }