feat:save

This commit is contained in:
zyronon
2025-08-04 00:15:53 +08:00
parent d8b3ccab0a
commit 3fa1d34969
2 changed files with 4 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
import {Article, Word} from "@/types.ts";
import {useBaseStore} from "@/stores/base.ts";
import {markRaw} from "vue";
export function useWordOptions() {
@@ -14,11 +15,8 @@ export function useWordOptions() {
if (rIndex > -1) {
store.collectWord.words.splice(rIndex, 1)
} else {
let rIndex = store.known.words.findIndex(v => v.word.toLowerCase() === val.word.toLowerCase())
if (rIndex > -1) {
store.known.words.splice(rIndex, 1)
}
store.collectWord.words.push(val)
// store.collectWord.words = markRaw(store.collectWord.words.concat([val]))
}
}

View File

@@ -76,10 +76,10 @@ export const useBaseStore = defineStore('base', {
return this.word.bookList[2]
},
knownWords(): string[] {
return this.known.words.map((v: Word) => v.word)
return this.known.words.map((v: Word) => v.word.toLowerCase())
},
knownWordsWithSimpleWords() {
return this.known.words.map((v: Word) => v.word).concat(this.simpleWords)
return this.known.words.map((v: Word) => v.word.toLowerCase()).concat(this.simpleWords)
},
currentStudyWordDict(): Dict {
if (this.word.studyIndex >= 0) {