diff --git a/src/App.vue b/src/App.vue index 8cb0fbf9..d0c4db8d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -41,9 +41,12 @@ watch(store.wrong.originWords, (n) => { useStartKeyboardEventListener() onMounted(() => { - store.init() - settingStore.init() - setTheme(settingStore.theme) + console.time() + Promise.allSettled([store.init(), settingStore.init()]).then(e => { + store.load = true + setTheme(settingStore.theme) + console.timeEnd() + }) }) useEventListener('keyup', (e: KeyboardEvent) => { diff --git a/src/components/MiniModal.vue b/src/components/MiniModal.vue index 310b1167..17f5f9b0 100644 --- a/src/components/MiniModal.vue +++ b/src/components/MiniModal.vue @@ -22,6 +22,14 @@ withDefaults(defineProps(), { \ No newline at end of file diff --git a/src/components/Practice/Practice.vue b/src/components/Practice/Practice.vue index 4469527a..c109ef1d 100644 --- a/src/components/Practice/Practice.vue +++ b/src/components/Practice/Practice.vue @@ -14,6 +14,7 @@ import {useRuntimeStore} from "@/stores/runtime.ts"; import {MessageBox} from "@/utils/MessageBox.tsx"; import PracticeArticle from "@/components/Practice/PracticeArticle/PracticeArticle.vue"; import PracticeWord from "@/components/Practice/PracticeWord/PracticeWord.vue"; +import VolumeSetting from "@/components/Toolbar/VolumeSetting.vue"; const practiceStore = usePracticeStore() const store = useBaseStore() @@ -70,8 +71,8 @@ function test() {
- - + +
show = false) -function toggle() { - if (!show) emitter.emit(EventKey.closeOther) - show = !show +let timer = 0 +function toggle(val) { + clearTimeout(timer) + if (val) { + emitter.emit(EventKey.closeOther) + show = val + } else { + timer = setTimeout(() => { + show = val + }, 100) + } } onMounted(() => { @@ -31,11 +39,15 @@ onMounted(() => { + @mouseenter="toggle(true)" + @mouseleave="toggle(false)" + />
选择单词的循环次数
diff --git a/src/components/Toolbar/Toolbar.vue b/src/components/Toolbar/Toolbar.vue index dee852c9..5d46920e 100644 --- a/src/components/Toolbar/Toolbar.vue +++ b/src/components/Toolbar/Toolbar.vue @@ -10,7 +10,7 @@ import {Icon} from '@iconify/vue'; import IconWrapper from "@/components/IconWrapper.vue"; import {emitter, EventKey} from "@/utils/eventBus.ts" -import {watch} from "vue" +import {onMounted, watch} from "vue" import VolumeSetting from "@/components/Toolbar/VolumeSetting.vue"; import RepeatSetting from "@/components/Toolbar/RepeatSetting.vue"; import TranslateSetting from "@/components/Toolbar/TranslateSetting.vue"; @@ -51,8 +51,15 @@ function toggle() { moreOptionsRef.style.overflow = 'hidden' } settingStore.collapse = !settingStore.collapse - } + +watch(() => store.load, n => { + if (!settingStore.collapse) { + moreOptionsRef.style.overflow = 'unset' + } +}) + +