This commit is contained in:
gpu 2026-02-04 01:42:52 +08:00
parent 581af8bbbc
commit c35246e2cc

View File

@ -164,9 +164,17 @@ const handleCreated = (editor: IDomEditor) => {
editorRef.value = editor
//
// 使 nextTick
if (formData.content) {
console.log('[DanyeFormDialog] Setting initial content to editor:', formData.content.substring(0, 100))
editor.setHtml(formData.content)
// operations
editor.clear()
// 使 setTimeout clear
setTimeout(() => {
if (!editor.isDestroyed) {
editor.setHtml(formData.content)
}
}, 0)
}
}
@ -179,6 +187,16 @@ watch(() => props.modelValue, (visible) => {
console.log('[DanyeFormDialog] formData.content set to:', formData.content.substring(0, 100))
console.log('[DanyeFormDialog] editorRef.value:', editorRef.value)
console.log('[DanyeFormDialog] editorRef.value?.isDestroyed:', editorRef.value?.isDestroyed)
//
if (editorRef.value && !editorRef.value.isDestroyed) {
editorRef.value.clear()
setTimeout(() => {
if (editorRef.value && !editorRef.value.isDestroyed) {
editorRef.value.setHtml(formData.content)
}
}, 0)
}
}
})