Narrow startup common ui imports

This commit is contained in:
2026-06-09 14:12:33 +08:00
parent 5519786fa7
commit ed63f43839
5 changed files with 14 additions and 11 deletions
@@ -5,14 +5,16 @@
import type { Component } from 'vue'; import type { Component } from 'vue';
import type { BaseFormComponentType } from '@vben/common-ui'; import type { BaseFormComponentType } from '@vben-core/form-ui';
import type { Recordable } from '@vben/types'; import type { Recordable } from '@vben/types';
import { defineAsyncComponent, defineComponent, h, ref } from 'vue'; import { defineAsyncComponent, defineComponent, h, ref } from 'vue';
import { ApiComponent, globalShareState } from '@vben/common-ui'; import { globalShareState } from '@vben-core/shared/global-state';
import { $t } from '@vben/locales'; import { $t } from '@vben/locales';
import { ApiComponent } from '@vben/common-ui/es/api-component';
const ElButton = defineAsyncComponent(() => const ElButton = defineAsyncComponent(() =>
import('element-plus/es/components/button/index').then((res) => res.ElButton), import('element-plus/es/components/button/index').then((res) => res.ElButton),
); );
+2 -2
View File
@@ -1,11 +1,11 @@
import type { import type {
VbenFormSchema as FormSchema, VbenFormSchema as FormSchema,
VbenFormProps, VbenFormProps,
} from '@vben/common-ui'; } from '@vben-core/form-ui';
import type { ComponentType } from './component'; import type { ComponentType } from './component';
import { setupVbenForm, useVbenForm as useForm, z } from '@vben/common-ui'; import { setupVbenForm, useVbenForm as useForm, z } from '@vben-core/form-ui';
import { $t } from '@vben/locales'; import { $t } from '@vben/locales';
async function initSetupVbenForm() { async function initSetupVbenForm() {
-7
View File
@@ -1,7 +1,6 @@
import { createApp, watchEffect } from 'vue'; import { createApp, watchEffect } from 'vue';
import { registerAccessDirective } from '@vben/access'; import { registerAccessDirective } from '@vben/access';
import { registerLoadingDirective } from '@vben/common-ui';
import { preferences } from '@vben/preferences'; import { preferences } from '@vben/preferences';
import { initStores } from '@vben/stores'; import { initStores } from '@vben/stores';
import '@vben/styles'; import '@vben/styles';
@@ -43,12 +42,6 @@ async function bootstrap(namespace: string) {
setupElementPlus(app); setupElementPlus(app);
// 注册Vben提供的v-loading和v-spinning指令
registerLoadingDirective(app, {
loading: false, // Vben提供的v-loading指令和Element Plus提供的v-loading指令二选一即可,此处false表示不注册Vben提供的v-loading指令
spinning: 'spinning',
});
// 国际化 i18n 配置 // 国际化 i18n 配置
await setupI18n(app); await setupI18n(app);
+4
View File
@@ -109,6 +109,10 @@ export default defineConfig(async () => {
'@vben/common-ui/es/tippy', '@vben/common-ui/es/tippy',
'../../packages/effects/common-ui/src/components/tippy/index.ts', '../../packages/effects/common-ui/src/components/tippy/index.ts',
), ),
exactAlias(
'@vben/common-ui/es/api-component',
'../../packages/effects/common-ui/src/components/api-component/index.ts',
),
exactAlias( exactAlias(
'@vben/constants', '@vben/constants',
'../../packages/constants/src/index.ts', '../../packages/constants/src/index.ts',
@@ -25,6 +25,10 @@
"./es/loading": { "./es/loading": {
"types": "./src/components/loading/index.ts", "types": "./src/components/loading/index.ts",
"default": "./src/components/loading/index.ts" "default": "./src/components/loading/index.ts"
},
"./es/api-component": {
"types": "./src/components/api-component/index.ts",
"default": "./src/components/api-component/index.ts"
} }
}, },
"dependencies": { "dependencies": {