新建antd-custom.ts
```
// 这里用于规定传入installAntd的类型
import { App } from '@vue/runtime-dom'
import { Button, message, Form, Input } from 'ant-design-vue'
// 按需引入
export default function installAntd(app: App): void {
app.use(Button)
app.use(Form)
app.use(Input)
app.config.globalProperties.$message = message
}
```
* main.js 中调用installAntd
~~~
import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from './router/index'
import store from './store/index'
import installAntd from './utils/antd-custom'
const app = createApp(App)
// 路由管理
app.use(router)
// 状态管理
app.use(store)
// antd组件
installAntd(app)
app.mount('#app')
~~~