diff --git a/src/App.vue b/src/App.vue index 223533079..1c72f305a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,6 +4,7 @@ import { NConfigProvider, darkTheme } from 'naive-ui'; import { useAppStore } from './store/modules/app'; import { useThemeStore } from './store/modules/theme'; import { naiveDateLocales, naiveLocales } from './locales/naive'; +import AppLoading from './components/common/app-loading.vue'; defineOptions({ name: 'App' @@ -24,17 +25,22 @@ const naiveDateLocale = computed(() => { diff --git a/src/main.ts b/src/main.ts index 2d7b63b33..787e1973c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,9 +4,14 @@ import { setupDayjs, setupIconifyOffline, setupNProgress } from './plugins'; import { setupStore } from './store'; import { setupRouter } from './router'; import { setupI18n } from './locales'; +import AppLoading from './components/common/app-loading.vue'; import App from './App.vue'; async function setupApp() { + const appLoading = createApp(AppLoading); + + appLoading.mount('#appLoading'); + setupNProgress(); setupIconifyOffline(); @@ -22,6 +27,8 @@ async function setupApp() { setupI18n(app); app.mount('#app'); + + appLoading.unmount(); } setupApp(); diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index 87926b9d7..0841919c1 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -36,7 +36,6 @@ declare module 'vue' { NFormItem: typeof import('naive-ui')['NFormItem'] NInput: typeof import('naive-ui')['NInput'] NInputNumber: typeof import('naive-ui')['NInputNumber'] - NInputPassword: typeof import('naive-ui')['NInputPassword'] NLoadingBarProvider: typeof import('naive-ui')['NLoadingBarProvider'] NMenu: typeof import('naive-ui')['NMenu'] NMessageProvider: typeof import('naive-ui')['NMessageProvider']