mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-05 23:47:50 +08:00
feat: |UI| add loading for lazy load component (#597)
This commit is contained in:
@@ -23,7 +23,6 @@ import Telegram from './admin/Telegram.vue';
|
|||||||
import Webhook from './admin/Webhook.vue';
|
import Webhook from './admin/Webhook.vue';
|
||||||
import MailWebhook from './admin/MailWebhook.vue';
|
import MailWebhook from './admin/MailWebhook.vue';
|
||||||
import WorkerConfig from './admin/WorkerConfig.vue';
|
import WorkerConfig from './admin/WorkerConfig.vue';
|
||||||
import SendMail from './admin/SendMail.vue';
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
adminAuth, showAdminAuth, adminTab, loading,
|
adminAuth, showAdminAuth, adminTab, loading,
|
||||||
@@ -31,6 +30,12 @@ const {
|
|||||||
} = useGlobalState()
|
} = useGlobalState()
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
|
|
||||||
|
const SendMail = defineAsyncComponent(() => {
|
||||||
|
loading.value = true;
|
||||||
|
return import('./admin/SendMail.vue')
|
||||||
|
.finally(() => loading.value = false);
|
||||||
|
});
|
||||||
|
|
||||||
const authFunc = async () => {
|
const authFunc = async () => {
|
||||||
try {
|
try {
|
||||||
adminAuth.value = tmpAdminAuth.value;
|
adminAuth.value = tmpAdminAuth.value;
|
||||||
|
|||||||
@@ -126,7 +126,9 @@ const menuOptions = computed(() => [
|
|||||||
type: menuValue.value == "admin" ? "primary" : "default",
|
type: menuValue.value == "admin" ? "primary" : "default",
|
||||||
style: "width: 100%",
|
style: "width: 100%",
|
||||||
onClick: async () => {
|
onClick: async () => {
|
||||||
|
loading.value = true;
|
||||||
await router.push(getRouterPathWithLang('/admin', locale.value));
|
await router.push(getRouterPathWithLang('/admin', locale.value));
|
||||||
|
loading.value = false;
|
||||||
showMobileMenu.value = false;
|
showMobileMenu.value = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -214,7 +216,9 @@ const logoClick = async () => {
|
|||||||
if (logoClickCount.value >= 5) {
|
if (logoClickCount.value >= 5) {
|
||||||
logoClickCount.value = 0;
|
logoClickCount.value = 0;
|
||||||
message.info("Change to admin Page");
|
message.info("Change to admin Page");
|
||||||
|
loading.value = true;
|
||||||
await router.push(getRouterPathWithLang('/admin', locale.value));
|
await router.push(getRouterPathWithLang('/admin', locale.value));
|
||||||
|
loading.value = false;
|
||||||
} else {
|
} else {
|
||||||
logoClickCount.value++;
|
logoClickCount.value++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,11 +15,16 @@ import Webhook from './index/Webhook.vue';
|
|||||||
import Attachment from './index/Attachment.vue';
|
import Attachment from './index/Attachment.vue';
|
||||||
import About from './common/About.vue';
|
import About from './common/About.vue';
|
||||||
|
|
||||||
const SendMail = defineAsyncComponent(() => import('./index/SendMail.vue'));
|
const { loading, settings, openSettings, indexTab, globalTabplacement } = useGlobalState()
|
||||||
const { settings, openSettings, indexTab, globalTabplacement } = useGlobalState()
|
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
|
const SendMail = defineAsyncComponent(() => {
|
||||||
|
loading.value = true;
|
||||||
|
return import('./index/SendMail.vue')
|
||||||
|
.finally(() => loading.value = false);
|
||||||
|
});
|
||||||
|
|
||||||
const { t } = useI18n({
|
const { t } = useI18n({
|
||||||
messages: {
|
messages: {
|
||||||
en: {
|
en: {
|
||||||
|
|||||||
Reference in New Issue
Block a user