diff --git a/server/HoneyBox/src/HoneyBox.Admin/admin-web/src/views/business/danye/components/DanyeFormDialog.vue b/server/HoneyBox/src/HoneyBox.Admin/admin-web/src/views/business/danye/components/DanyeFormDialog.vue index 80059963..c527941a 100644 --- a/server/HoneyBox/src/HoneyBox.Admin/admin-web/src/views/business/danye/components/DanyeFormDialog.vue +++ b/server/HoneyBox/src/HoneyBox.Admin/admin-web/src/views/business/danye/components/DanyeFormDialog.vue @@ -22,7 +22,7 @@ -
+
-
+
加载编辑器中...
@@ -84,7 +84,7 @@ const dialogVisible = computed({ // 编辑器实例 const editorRef = shallowRef() -const editorReady = ref(false) +const showEditor = ref(false) const mode = 'default' // 工具栏配置 @@ -198,7 +198,6 @@ const handleCreated = (editor: IDomEditor) => { } } } - editorReady.value = true }, 100) }) } @@ -209,7 +208,10 @@ watch(() => props.modelValue, (visible) => { if (visible && props.danye) { formData.title = props.danye.title formData.content = props.danye.content || '' - editorReady.value = false + // 延迟显示编辑器,确保弹窗已渲染 + nextTick(() => { + showEditor.value = true + }) } }) @@ -217,7 +219,7 @@ watch(() => props.modelValue, (visible) => { watch(dialogVisible, (visible) => { console.log('[DanyeFormDialog] dialogVisible changed:', visible) if (!visible) { - editorReady.value = false + showEditor.value = false } }) @@ -233,7 +235,7 @@ onBeforeUnmount(() => { const resetForm = () => { formData.title = '' formData.content = '' - editorReady.value = false + showEditor.value = false formRef.value?.resetFields() } @@ -244,7 +246,7 @@ const handleClose = () => { editorRef.value.destroy() editorRef.value = undefined } - editorReady.value = false + showEditor.value = false dialogVisible.value = false resetForm() }