liyongli пре 1 година
родитељ
комит
b9617225e0
2 измењених фајлова са 5 додато и 6 уклоњено
  1. 5 5
      src/components/editor.vue
  2. 0 1
      src/view/allMedia/proofread.vue

+ 5 - 5
src/components/editor.vue

@@ -4,7 +4,6 @@
       :class="{ text: true }"
       contenteditable
       ref="editor"
-      v-html="rawText"
       @input="input"
     ></div>
     <div v-if="!rawText" class="defaultText" v-html="defaultSl + dfaultText"></div>
@@ -28,12 +27,13 @@ export default {
       defaultSl: '<p style="margin: 10px auto; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 16px; line-height: 34.2px; font-family: &quot;Microsoft Yahei&quot;  color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);"><span>(示例)</span></p>' 
     };
   },
-  beforeMount() {},
-  methods: {
-    input(e) {
-      this.$emit('update:rawText', e.target.innerHTML || '');
+  watch: {
+    rawText(val) {
+      this.$refs.editor.innerHTML = val;
     },
   },
+  beforeMount() {},
+  methods: {},
   emits: ['update:rawText'],
 };
 </script>

+ 0 - 1
src/view/allMedia/proofread.vue

@@ -163,7 +163,6 @@ function getServer() {
   }).then(res => {
     const list = res.checklist || [];
     let rawTextF = res.rawText || '';
-    console.log(list);
     for (let i = 0; i < list.length; i++) {
       const v = list[i];
       const r = new RegExp(`data-umpos="${v.colorPosition}"`, 'g');