diff --git a/src/components/Modal/Statistics.vue b/src/components/Modal/Statistics.vue index 5ccf46cd..3b9af55b 100644 --- a/src/components/Modal/Statistics.vue +++ b/src/components/Modal/Statistics.vue @@ -30,9 +30,14 @@ function next() { } function repeatWrong() { - store.lastDictType = store.currentDictType + if (store.currentDictType !== DictType.currentWrongDict){ + store.lastDictType = store.currentDictType + } store.currentDictType = DictType.currentWrongDict store.currentWrongDict.chapterList = [store.currentWrongDict.wordList] + store.currentWrongDict.chapterIndex = 0 + store.currentWrongDict.wordIndex = 0 + store.currentWrongDict.wordList = [] store.statModalIsOpen = false } diff --git a/src/components/Side.vue b/src/components/Side.vue index 6cee1367..ffd75bab 100644 --- a/src/components/Side.vue +++ b/src/components/Side.vue @@ -4,7 +4,7 @@ import WordList from "@/components/WordList.vue" import {ArrowLeft, ArrowRight, MenuFold} from '@icon-park/vue-next' import {$ref} from "vue/macros" -import {computed, provide} from "vue" +import {computed, nextTick, onMounted, provide} from "vue" import {Swiper, SwiperSlide} from 'swiper/vue'; import 'swiper/css'; import {Swiper as SwiperClass} from "swiper/types" @@ -14,13 +14,19 @@ import BaseButton from "@/components/BaseButton.vue"; const store = useBaseStore() const swiperIns0: SwiperClass = $ref(null as any) -let tabIndex = $ref(0) +let tabIndex = $ref(1) provide('tabIndex', computed(() => tabIndex)) function slideTo(index: number) { swiperIns0.slideTo(tabIndex = index) } +onMounted(() => { + setTimeout(() => { + slideTo(1) + }, 300) +}) + function changeDict(dict: Dict, i: number) { if (store.currentDictType !== dict.type) { store.currentDictType = dict.type @@ -31,17 +37,41 @@ function changeDict(dict: Dict, i: number) {