From 81b5e897c13028a20c565e7ea4ad3c91f12a2063 Mon Sep 17 00:00:00 2001 From: Zyronon Date: Mon, 15 Sep 2025 15:24:25 +0800 Subject: [PATCH 1/2] Update DictDetail.vue --- src/pages/pc/word/DictDetail.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/pc/word/DictDetail.vue b/src/pages/pc/word/DictDetail.vue index e0ce3254..79f31473 100644 --- a/src/pages/pc/word/DictDetail.vue +++ b/src/pages/pc/word/DictDetail.vue @@ -73,7 +73,7 @@ let studyLoading = $ref(false) function syncDictInMyStudyList(study = false) { _nextTick(() => { let rIndex = base.word.bookList.findIndex(v => v.id === runtimeStore.editDict.id) - let temp = cloneDeep(runtimeStore.editDict); + let temp = runtimeStore.editDict; if (!temp.custom && ![DictId.wordKnown, DictId.wordWrong, DictId.wordCollect].includes(temp.id)) { temp.custom = true temp.id += '_custom' @@ -265,6 +265,7 @@ function importData(e) { let data = null try { data = convertToWord({ + id : nanoid(6), word: v['单词'], phonetic0: v['音标①'] ?? '', phonetic1: v['音标②'] ?? '', From 50a417c9d65e295c134117afa2e733cce19ac6bf Mon Sep 17 00:00:00 2001 From: Zyronon Date: Mon, 15 Sep 2025 15:24:56 +0800 Subject: [PATCH 2/2] Update func.ts --- src/types/func.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/func.ts b/src/types/func.ts index ce919878..fac3317f 100644 --- a/src/types/func.ts +++ b/src/types/func.ts @@ -6,6 +6,7 @@ import {nanoid} from "nanoid"; export function getDefaultWord(val: Partial = {}): Word { return { custom: false, + id : nanoid(6), "word": "", "phonetic0": "", "phonetic1": "", @@ -18,8 +19,7 @@ export function getDefaultWord(val: Partial = {}): Word { "rels": [] }, "etymology": [], - ...val, - id: val?.id ? val.id : nanoid(6), + ...val } }