Register only used Element Plus components

This commit is contained in:
2026-06-09 09:21:29 +08:00
parent ad040ac6f9
commit 42e49a1b34
2 changed files with 147 additions and 6 deletions
+2 -6
View File
@@ -8,8 +8,6 @@ import '@vben/styles';
import '@vben/styles/ele';
import { useTitle } from '@vueuse/core';
import ElementPlus from 'element-plus';
import { ElLoading } from 'element-plus';
import { $t, setupI18n } from '#/locales';
@@ -17,6 +15,7 @@ import { initComponentAdapter } from './adapter/component';
import { initSetupVbenForm, useVbenForm } from './adapter/form';
import App from './app.vue';
import { setupZqTable } from './components/zq-table';
import { setupElementPlus } from './plugins/element-plus';
import { router } from './router';
async function bootstrap(namespace: string) {
@@ -41,10 +40,7 @@ async function bootstrap(namespace: string) {
// });
const app = createApp(App);
app.use(ElementPlus);
// 注册Element Plus提供的v-loading指令
app.directive('loading', ElLoading.directive);
setupElementPlus(app);
// 注册Vben提供的v-loading和v-spinning指令
registerLoadingDirective(app, {