chore: button设置为全局组件 解决每次启动重复的依赖构建
This commit is contained in:
@@ -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);
|
||||
|
||||
|
10
apps/web-antd/src/components/global/index.ts
Normal file
10
apps/web-antd/src/components/global/index.ts
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user