feat: UI: lazy load (#266)

This commit is contained in:
Dream Hunter
2024-05-23 12:23:43 +08:00
committed by GitHub
parent aa04dc4efa
commit c976664f4e
5 changed files with 6 additions and 16 deletions

View File

@@ -1,8 +1,6 @@
import { createRouter, createWebHistory } from 'vue-router'
import Index from '../views/Index.vue'
import User from '../views/User.vue'
import Admin from '../views/Admin.vue'
import TelegramMail from '../views/telegram/Mail.vue'
const router = createRouter({
history: createWebHistory(),
@@ -17,11 +15,11 @@ const router = createRouter({
},
{
path: '/admin',
component: Admin
component: () => import('../views/Admin.vue')
},
{
path: '/telegram_mail',
component: TelegramMail
component: () => import('../views/telegram/Mail.vue')
},
]
})

View File

@@ -1,4 +1,5 @@
<script setup>
import { defineAsyncComponent } from 'vue'
import { useI18n } from 'vue-i18n'
import { useGlobalState } from '../store'
@@ -8,11 +9,11 @@ import AddressBar from './index/AddressBar.vue';
import MailBox from '../components/MailBox.vue';
import SendBox from '../components/SendBox.vue';
import AutoReply from './index/AutoReply.vue';
import SendMail from './index/SendMail.vue';
import AccountSettings from './index/AccountSettings.vue';
import WenHook from './index/Webhook.vue';
import About from './common/About.vue';
const SendMail = defineAsyncComponent(() => import('./index/SendMail.vue'));
const { localeCache, settings, openSettings, indexTab, globalTabplacement } = useGlobalState()
const { t } = useI18n({