diff --git a/src/components/Side.vue b/src/components/Side.vue index d8cd71cc..d15d0202 100644 --- a/src/components/Side.vue +++ b/src/components/Side.vue @@ -26,14 +26,14 @@ onMounted(() => { store.sideIsOpen = !store.sideIsOpen if (store.sideIsOpen) { switch (store.current.dictType) { - case DictType.newWordDict: + case DictType.newDict: return tabIndex = 1; - case DictType.skipWordDict: + case DictType.skipDict: return tabIndex = 3; - case DictType.wrongWordDict: + case DictType.wrongDict: return tabIndex = 2; - case DictType.inner: - case DictType.custom: + case DictType.innerDict: + case DictType.customDict: return tabIndex = 0; } } @@ -42,7 +42,7 @@ onMounted(() => { const newWordDictActiveIndex = computed(() => { - if (store.current.dictType !== DictType.newWordDict) return -1 + if (store.current.dictType !== DictType.newDict) return -1 else { if (store.current.repeatNumber) { return store.chapter.findIndex(v => v.name === store.word.name) @@ -52,7 +52,7 @@ const newWordDictActiveIndex = computed(() => { }) const dictActiveIndex = computed(() => { - if (store.current.dictType !== DictType.inner) return -1 + if (store.current.dictType !== DictType.innerDict) return -1 else { if (store.current.repeatNumber) { return store.chapter.findIndex(v => v.name === store.word.name) @@ -63,7 +63,7 @@ const dictActiveIndex = computed(() => { const wrongWordDictActiveIndex = computed(() => { - if (store.current.dictType !== DictType.wrongWordDict) return -1 + if (store.current.dictType !== DictType.wrongDict) return -1 else { if (store.current.repeatNumber) { return store.chapter.findIndex(v => v.name === store.word.name) @@ -74,7 +74,7 @@ const wrongWordDictActiveIndex = computed(() => { const skipWordDictActiveIndex = computed(() => { - if (store.current.dictType !== DictType.skipWordDict) return -1 + if (store.current.dictType !== DictType.skipDict) return -1 else { if (store.current.repeatNumber) { return store.chapter.findIndex(v => v.name === store.word.name) @@ -106,9 +106,9 @@ const skipWordDictActiveIndex = computed(() => { class="word-list" @change="(e:number) => store.changeDict(store.dict,store.dict.chapterIndex,e)" :isActive="store.sideIsOpen && tabIndex === 0" - :list="store.dict.chapters[store.dict.chapterIndex]??[]" + :list="store.dict.chapterWords[store.dict.chapterIndex]??[]" :activeIndex="dictActiveIndex"/> -