chore: button设置为全局组件 解决每次启动重复的依赖构建

This commit is contained in:
dap
2024-09-19 08:39:47 +08:00
parent c46f87487f
commit fb79c9e63d
3 changed files with 188 additions and 211 deletions

View File

@@ -5,6 +5,7 @@ import { initStores } from '@vben/stores';
import '@vben/styles';
import '@vben/styles/antd';
import { setupGlobalComponent } from '#/components/global';
import { setupI18n } from '#/locales';
import App from './app.vue';
@@ -13,6 +14,9 @@ import { router } from './router';
async function bootstrap(namespace: string) {
const app = createApp(App);
// 全局组件
setupGlobalComponent(app);
// 国际化 i18n 配置
await setupI18n(app);

View File

@@ -0,0 +1,10 @@
import type { App } from 'vue';
import { Button as AButton } from 'ant-design-vue';
/**
* 全局组件注册
*/
export function setupGlobalComponent(app: App) {
app.use(AButton);
}