Lazy load layout secondary widgets

This commit is contained in:
2026-06-09 14:57:45 +08:00
parent a5b4492f8f
commit 80cc79659a
2 changed files with 22 additions and 2 deletions
+10 -2
View File
@@ -16,9 +16,8 @@ import {
} from 'vue';
import { useRouter } from 'vue-router';
import { AuthenticationLoginExpiredModal } from '@vben/common-ui';
import { useWatermark } from '@vben/hooks';
import { BasicLayout, LockScreen, UserDropdown } from '@vben/layouts';
import { BasicLayout } from '@vben/layouts';
import { $t } from '@vben/locales';
import { preferences } from '@vben/preferences';
import { useAccessStore, useUserStore } from '@vben/stores';
@@ -29,6 +28,15 @@ import { useAuthStore } from '#/store';
const LoginForm = defineAsyncComponent(
() => import('#/views/_core/authentication/login.vue'),
);
const AuthenticationLoginExpiredModal = defineAsyncComponent(() =>
import('@vben/common-ui/es/login-expired-modal'),
);
const UserDropdown = defineAsyncComponent(() =>
import('@vben/layouts/es/user-dropdown').then((module) => module.UserDropdown),
);
const LockScreen = defineAsyncComponent(() =>
import('@vben/layouts/es/lock-screen').then((module) => module.LockScreen),
);
const NotificationPopup = defineAsyncComponent(
() => import('#/components/notification/NotificationPopup.vue'),
);