From 9f34c72ab0bab7773756116aa4b94604249a4dbb Mon Sep 17 00:00:00 2001 From: Tim <135014430+nagisa77@users.noreply.github.com> Date: Fri, 4 Jul 2025 16:41:08 +0800 Subject: [PATCH] fix(editor): initialize vditor after setup --- open-isle-cli/src/components/CommentEditor.vue | 5 ++++- open-isle-cli/src/components/PostEditor.vue | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/open-isle-cli/src/components/CommentEditor.vue b/open-isle-cli/src/components/CommentEditor.vue index c0a9cb669..568ebbece 100644 --- a/open-isle-cli/src/components/CommentEditor.vue +++ b/open-isle-cli/src/components/CommentEditor.vue @@ -60,7 +60,10 @@ export default { 'link', 'image' ], - toolbarConfig: { pin: true } + toolbarConfig: { pin: true }, + after() { + vditorInstance.value = this + } }) }) diff --git a/open-isle-cli/src/components/PostEditor.vue b/open-isle-cli/src/components/PostEditor.vue index f18b17f50..3ac374de0 100644 --- a/open-isle-cli/src/components/PostEditor.vue +++ b/open-isle-cli/src/components/PostEditor.vue @@ -57,9 +57,11 @@ export default { cache: { enable: false }, input(value) { emit('update:modelValue', value) + }, + after() { + vditorInstance.value.setValue(props.modelValue) } }) - vditorInstance.value.setValue(props.modelValue) }) return {}