From d7d8c3782cc756459e4496df5542cec39ffb2eda Mon Sep 17 00:00:00 2001 From: zyronon Date: Sat, 2 Dec 2023 22:00:19 +0800 Subject: [PATCH] Fixed a bug where the toggle dictionary could not load words --- src/components/list/BaseList.vue | 2 +- src/pages/practice/index.vue | 1 - src/pages/practice/practice-article/index.vue | 9 ++++----- src/pages/practice/practice-word/index.vue | 18 ++++++++++-------- src/stores/base.ts | 2 ++ 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/components/list/BaseList.vue b/src/components/list/BaseList.vue index 875c8829..16fae05d 100644 --- a/src/components/list/BaseList.vue +++ b/src/components/list/BaseList.vue @@ -27,7 +27,7 @@ const emit = defineEmits<{ }>() //虚拟列表长度限制 -const limit = 99 +const limit = 101 const settingStore = useSettingStore() const listRef: any = $ref() diff --git a/src/pages/practice/index.vue b/src/pages/practice/index.vue index 15c84769..ccaa60ad 100644 --- a/src/pages/practice/index.vue +++ b/src/pages/practice/index.vue @@ -133,7 +133,6 @@ onMounted(() => { emitter.on(ShortcutKey.ToggleTheme, toggleTheme) emitter.on(ShortcutKey.ToggleConciseMode, toggleConciseMode) emitter.on(ShortcutKey.TogglePanel, togglePanel) - practiceRef.getCurrentPractice() }) onUnmounted(() => { diff --git a/src/pages/practice/practice-article/index.vue b/src/pages/practice/practice-article/index.vue index 54696659..50f08c9c 100644 --- a/src/pages/practice/practice-article/index.vue +++ b/src/pages/practice/practice-article/index.vue @@ -44,13 +44,10 @@ watch([ // () => store.load, () => store.currentDict.articles, ], n => { - console.log('n', n) getCurrentPractice() }) -onMounted(() => { - getCurrentPractice() -}) +onMounted(getCurrentPractice) function setArticle(val: Article) { store.currentDict.articles[store.currentDict.chapterIndex] = cloneDeep(val) @@ -218,13 +215,15 @@ function changePracticeArticle(val: { } } -defineExpose({getCurrentPractice}) const settingStore = useSettingStore() const { isArticleCollect, toggleArticleCollect } = useArticleOptions() + +defineExpose({getCurrentPractice}) +