From ac508d5eb4c1f2883f2fea9b9f39cf6dc681d0ed Mon Sep 17 00:00:00 2001 From: Sunwuyuan Date: Sun, 7 Dec 2025 13:31:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=8D=A1=E7=89=87=E5=86=85=E5=AE=B9=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E6=97=B6=E5=88=A0=E9=99=A4=E5=8D=A1=E7=89=87=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/index.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pages/index.vue b/src/pages/index.vue index 224818e..25b833e 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -1143,6 +1143,16 @@ export default { this.state.boardData.homework[this.currentEditSubject]?.content || ""; if (content !== originalContent.trim()) { + // 如果内容为空且是自定义卡片,则删除该卡片 + if (!content && this.currentEditSubject.startsWith('custom-')) { + delete this.state.boardData.homework[this.currentEditSubject]; + this.state.synced = false; + if (this.autoSave) { + await this.trySave(true); + } + this.state.dialogVisible = false; + return; + } // 如果是自定义卡片,保留其他属性 if (this.state.boardData.homework[this.currentEditSubject].type === 'custom') { this.state.boardData.homework[this.currentEditSubject].content = content;