From ff401a524ba8b241c36e1273dc9deaa19619dad5 Mon Sep 17 00:00:00 2001 From: npmrun <1549469775@qq.com> Date: Mon, 27 Apr 2026 09:42:43 +0800 Subject: [PATCH] feat(editor): add loading state for markdown editor initialization - Introduced a loading overlay that displays while the markdown editor is being initialized, enhancing user experience during the loading phase. - Added a reactive property to manage the editor's readiness state, ensuring the UI reflects the editor's status accurately. - Updated the component structure to accommodate the new loading state, improving visual feedback for users. These changes improve the usability of the markdown editor by providing clear indications of its loading status. --- app/components/PostBodyMarkdownEditor.vue | 24 +++++++++++++++++++----- packages/drizzle-pkg/db.sqlite | Bin 188416 -> 188416 bytes 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/components/PostBodyMarkdownEditor.vue b/app/components/PostBodyMarkdownEditor.vue index 0d2049f..500b0c5 100644 --- a/app/components/PostBodyMarkdownEditor.vue +++ b/app/components/PostBodyMarkdownEditor.vue @@ -16,6 +16,7 @@ const emit = defineEmits<{ const toast = useToast() const mountEl = ref(null) const isMobileViewport = ref(false) +const isEditorReady = ref(false) const editorContainerStyle = computed(() => { if (isMobileViewport.value) { return { @@ -89,6 +90,7 @@ onMounted(async () => { vditorCtor.value = ctor if (mountEl.value) { bridge.mount(mountEl.value) + isEditorReady.value = true } }, onError: (error) => { @@ -103,6 +105,7 @@ watch(() => props.modelValue, () => { onBeforeUnmount(() => { unmounted = true + isEditorReady.value = false if (viewportMql && onViewportChange) { viewportMql.removeEventListener('change', onViewportChange) } @@ -114,11 +117,22 @@ onBeforeUnmount(() => {