From 4ac461ee2c4583b7ae89cb32f9eb5cf1e4d09c66 Mon Sep 17 00:00:00 2001 From: feiben Date: Tue, 31 Oct 2023 14:18:30 +0800 Subject: [PATCH] fix: Fix the issue of editor not being initialized completely. --- src/main/ts/components/Editor.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/ts/components/Editor.ts b/src/main/ts/components/Editor.ts index 2f494e3..3179d89 100644 --- a/src/main/ts/components/Editor.ts +++ b/src/main/ts/components/Editor.ts @@ -104,7 +104,7 @@ export const Editor = defineComponent({ } }); onBeforeUnmount(() => { - if (getTinymce() !== null) { + if (getTinymce() !== null && vueEditor !== null) { getTinymce().remove(vueEditor); } }); @@ -118,7 +118,9 @@ export const Editor = defineComponent({ if (!modelBind) { cache = vueEditor.getContent(); } - getTinymce()?.remove(vueEditor); + if (vueEditor !== null) { + getTinymce()?.remove(vueEditor); + } }); } const rerender = (init: EditorOptions) => {