Explorar o código

fix:富文本在 val 为 null 会报错的问题

YunaiV hai 5 meses
pai
achega
7c710d2afe
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      src/components/Editor/src/Editor.vue

+ 3 - 0
src/components/Editor/src/Editor.vue

@@ -40,6 +40,9 @@ const valueHtml = ref('')
 watch(
   () => props.modelValue,
   (val: string) => {
+    if (!val) {
+      val = ''
+    }
     if (val === unref(valueHtml)) return
     valueHtml.value = val
   },