55 <MinimumResolutionWarning />
66 </header >
77 <img :src =" iconLoadingBlock" :class =" { 'd-none': !routeUpdatingStore.isUpdating }" id =" loading-block" />
8+ <div
9+ :class =" { 'visually-hidden': !globalLoadingStore.isLoading }"
10+ class =" spinner-border text-primary" role =" status" id =" global-loading-spinner" >
11+ <span class =" visually-hidden" >Loading...</span >
12+ </div >
813 <main >
914 <AConfigProvider :locale =" AntdZhCn " >
1015 <slot v-if =" !routeUpdatingStore.isUpdating" />
4045<script setup lang="ts">
4146import iconLoadingBlock from ' assets/icon-loading-block.svg' ;
4247import AntdZhCn from ' ant-design-vue/es/locale/zh_CN' ;
43- import nProgress from ' nprogress' ;
4448
45- const routeUpdatingStore = useRouteUpdatingStore ();
4649const config = useRuntimeConfig ().public ;
50+ const routeUpdatingStore = useRouteUpdatingStore ();
51+ const globalLoadingStore = useGlobalLoadingStore ();
4752const isReCAPTCHAEnabled = config .recaptchaSiteKey !== ' ' ;
4853const isGoogleAnalyticsEnabled = config .gaMeasurementId !== ' ' ;
4954
5055const noScriptStyle = ` <style>
5156 #app-wrapper {
5257 pointer-events: unset !important;
5358 }
59+ #global-loading-spinner {
60+ visibility: hidden;
61+ }
5462</style> ` ; // https://github.com/nuxt/nuxt/issues/13848
5563useHead ({ noscript: [{ innerHTML: noScriptStyle }] });
5664const appPointerEvents = ref (' none' );
5765if (import .meta .client ) {
58- nProgress .start ();
66+ globalLoadingStore .start ();
5967 onNuxtReady (() => {
60- nProgress . done ();
68+ globalLoadingStore . stop ();
6169 appPointerEvents .value = ' unset' ;
6270 });
6371}
@@ -74,6 +82,12 @@ if (import.meta.client) {
7482#footer-lower {
7583 background-color : rgba (0 ,0 ,0 ,.2 );
7684}
85+
86+ #global-loading-spinner {
87+ position : absolute ;
88+ right : 1rem ;
89+ top : 1rem ;
90+ }
7791#loading-block {
7892 height : 200px ;
7993 margin : auto ;
0 commit comments