1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2025-12-07 21:13:11 +00:00

feat: 添加自定义卡片内容为空时删除卡片的功能

This commit is contained in:
Sunwuyuan 2025-12-07 13:31:41 +08:00
parent 1831c9144d
commit ac508d5eb4
No known key found for this signature in database
GPG Key ID: A6A54CF66F56BB64

View File

@ -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;