From 7d8297bb96e55b9ad5b6f7a08b50948964e4708e Mon Sep 17 00:00:00 2001 From: ikmkj <1@qq,com> Date: Sat, 2 Aug 2025 01:49:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(biji-qianduan):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E7=AC=94=E8=AE=B0=E5=90=8E=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9B=B4=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 editData.value 和 selectedFile.value 的更新方式从 response.data 改为直接使用 response - 优化了新创建笔记的 ID 获取逻辑 -确保在保存笔记后正确更新前端状态 --- biji-qianduan/src/components/HomePage.vue | 6 +++--- mydatabase.db | Bin 65536 -> 65536 bytes 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/biji-qianduan/src/components/HomePage.vue b/biji-qianduan/src/components/HomePage.vue index 6363922..e0fd4af 100644 --- a/biji-qianduan/src/components/HomePage.vue +++ b/biji-qianduan/src/components/HomePage.vue @@ -626,11 +626,11 @@ const handleSave = async (content) => { // 使用后端返回的完整、最新的数据更新前端状态 // 这对于新创建的笔记至关重要,因为它会获得一个新的 ID - editData.value = response.data; + editData.value = response; // 如果当前正在预览这个文件,也更新 selectedFile - if (selectedFile.value && (!selectedFile.value.id || selectedFile.value.id === response.data.id)) { - selectedFile.value = response.data; + if (selectedFile.value && (!selectedFile.value.id || selectedFile.value.id === response.id)) { + selectedFile.value = response; } saveStatus.value = '已保存'; diff --git a/mydatabase.db b/mydatabase.db index 914edc9256b90ced0f154aaf1ebd213c0e2aba8d..886b03e8e5bd764f8811aa3189ebf3fca0d0e5fb 100644 GIT binary patch delta 114 zcmZo@U}k9_G;Dn7SbJz2-Nii@p^Dr=nvc)m;Y@GOoNeUpcLc8IZLov#f500096RR9B323`glv5`juvsJUj X0t7mOucVV6wmbx1F`q88Ubdo1u`Cu8