From 76269c50fe23c6b862f3cafff8bbbd9c90225b08 Mon Sep 17 00:00:00 2001 From: zyronon Date: Thu, 9 Nov 2023 01:42:02 +0800 Subject: [PATCH] Adding loading effects when downloading a universal dictionary --- components.d.ts | 3 +++ src/App.vue | 11 +++++++---- src/components/Practice/PracticeWord/TypingWord.vue | 5 ++++- src/stores/base.ts | 4 +++- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/components.d.ts b/components.d.ts index 412774bd..2b805ad6 100644 --- a/components.d.ts +++ b/components.d.ts @@ -71,4 +71,7 @@ declare module 'vue' { WordList2: typeof import('./src/components/list/WordList2.vue')['default'] WordListModal: typeof import('./src/components/Modal/WordListModal.vue')['default'] } + export interface ComponentCustomProperties { + vLoading: typeof import('element-plus/es')['ElLoadingDirective'] + } } diff --git a/src/App.vue b/src/App.vue index 9cc999cb..f784acde 100644 --- a/src/App.vue +++ b/src/App.vue @@ -40,17 +40,20 @@ watch(store.wrong.originWords, (n) => { useStartKeyboardEventListener() -onMounted(() => { +async function init() { console.time() - Promise.allSettled([store.init(), settingStore.init()]).then(e => { + store.init().then(() => { store.load = true - setTheme(settingStore.theme) console.timeEnd() }) -}) + await settingStore.init() + setTheme(settingStore.theme) +} onMounted(() => { + init() }) +