feat: |UI| add loading for lazy load component (#597)

This commit is contained in:
Dream Hunter
2025-02-27 00:36:13 +08:00
committed by GitHub
parent 144a792cb2
commit 983300acf4
3 changed files with 17 additions and 3 deletions
+7 -2
View File
@@ -15,11 +15,16 @@ import Webhook from './index/Webhook.vue';
import Attachment from './index/Attachment.vue';
import About from './common/About.vue';
const SendMail = defineAsyncComponent(() => import('./index/SendMail.vue'));
const { settings, openSettings, indexTab, globalTabplacement } = useGlobalState()
const { loading, settings, openSettings, indexTab, globalTabplacement } = useGlobalState()
const message = useMessage()
const route = useRoute()
const SendMail = defineAsyncComponent(() => {
loading.value = true;
return import('./index/SendMail.vue')
.finally(() => loading.value = false);
});
const { t } = useI18n({
messages: {
en: {