liyongli 1 年之前
父節點
當前提交
ab9e2b9e1c
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/components/editor.vue

+ 2 - 1
src/components/editor.vue

@@ -34,9 +34,10 @@ export default {
   },
   watch: {
     rawText(val) {
-      this.$refs.editor.innerHTML = val;
+      if(val != this.$refs.editor.innerHTML) this.$refs.editor.innerHTML = val;
     },
   },
+  onmounted() {},
   beforeMount() {},
   methods: {
     input(e) {