This commit is contained in:
zyronon
2023-12-02 23:05:56 +08:00
parent d7d8c3782c
commit e789822da4
10 changed files with 174 additions and 132 deletions

View File

@@ -82,7 +82,7 @@ function scrollToBottom() {
}
function scrollToItem(index: number) {
listRef.scrollToItem(index)
nextTick(() => listRef.scrollToItem(index))
}
defineExpose({scrollToBottom, scrollToItem})

View File

@@ -157,8 +157,17 @@ let residueWordListCheckedTotal = $computed(() => {
function handleChangeCurrentChapter(val: {
index: number
}) {
chapterWordList.map(v => v.checked = false)
chapterIndex = val.index
chapterWordList.map(v => {
v.checked = false
//TODO 可能会存在卡的问题
if (!v.trans.length && runtimeStore.translateWordList.length) {
let res = runtimeStore.translateWordList.find(a => a.name === v.name)
if (res) v = Object.assign(v, res)
}
})
chapterWordListRef?.scrollToItem(0)
closeWordForm()
}

View File

@@ -14,7 +14,7 @@ import {MessageBox} from "@/utils/MessageBox.tsx";
import PracticeArticle from "@/pages/practice/practice-article/index.vue";
import PracticeWord from "@/pages/practice/practice-word/index.vue";
import {ShortcutKey} from "@/types.ts";
import useTheme from "@/hooks/useTheme.ts";
import useTheme from "@/hooks/theme.ts";
import SettingDialog from "@/components/dialog/SettingDialog.vue";
import DictModal from "@/components/dialog/DictDiglog.vue";