From a405a3bd906ea53ab410563229518bd290e99f5e Mon Sep 17 00:00:00 2001 From: Phoenix <64720302+Concur-max@users.noreply.github.com> Date: Wed, 2 Jul 2025 16:04:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(editor):=20=E5=88=87=E6=8D=A2=E4=BC=9A?= =?UTF-8?q?=E8=AF=9D=E6=97=B6=E6=B8=85=E7=A9=BA=E5=BC=95=E7=94=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=80=8C=E9=9D=9E=E4=BF=9D=E7=95=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改编辑器行为,在切换会话时主动清空引用数据而不是保留之前的引用。这避免了不同会话间引用数据的混淆问题。 --- src/components/editor/TiptapEditor.vue | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/components/editor/TiptapEditor.vue b/src/components/editor/TiptapEditor.vue index 77a8996..fa7b4a4 100644 --- a/src/components/editor/TiptapEditor.vue +++ b/src/components/editor/TiptapEditor.vue @@ -739,8 +739,7 @@ function onEditorChange() { function loadEditorDraftText() { if (!editor.value) return - // 保存当前引用数据 - const currentQuoteData = quoteData.value + // 切换会话时清空引用数据,不保存当前引用数据 quoteData.value = null // 从缓存中加载编辑器草稿 @@ -761,11 +760,6 @@ function loadEditorDraftText() { editor.value.commands.clearContent(true) // 没有草稿则清空编辑器 } - // 如果有当前引用数据,优先使用它 - if (currentQuoteData) { - quoteData.value = currentQuoteData - } - // 设置光标位置到末尾 editor.value.commands.focus('end') }