Browse Source

fix: 修复富文本编辑器初始化时, 报错 Error: Cannot find a descendant at path [0,1] in node

ddup 11 months ago
parent
commit
a65d5fd203
1 changed files with 1 additions and 3 deletions
  1. 1 3
      src/components/Editor/src/Editor.vue

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

@@ -35,9 +35,6 @@ watch(
   (val: string) => {
     if (val === unref(valueHtml)) return
     valueHtml.value = val
-  },
-  {
-    immediate: true
   }
 )
 
@@ -51,6 +48,7 @@ watch(
 
 const handleCreated = (editor: IDomEditor) => {
   editorRef.value = editor
+  valueHtml.value = props.modelValue
 }
 
 // 编辑器配置