Skip to content

Commit

Permalink
feat: antd的自动引入支持
Browse files Browse the repository at this point in the history
  • Loading branch information
markthree committed Feb 4, 2022
1 parent ae4a4e0 commit 9e25dba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ pnpm add naive-ui

- [naive ui](https://www.naiveui.com/zh-CN/os-theme)
- [element-plus](https://element-plus.gitee.io/zh-CN/)
- [ant design of vue](https://next.antdv.com/docs/vue/introduce-cn/)
- [@vueuse/components](https://vueuse.org/guide/components.html)

具体可见 👉 [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components)
Expand Down
2 changes: 2 additions & 0 deletions presets/tov.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import IconsResolver from 'unplugin-icons/resolver'
import Components from 'unplugin-vue-components/vite'
import {
NaiveUiResolver,
AntDesignVueResolver,
ElementPlusResolver,
VueUseComponentsResolver
} from 'unplugin-vue-components/resolvers'
Expand Down Expand Up @@ -65,6 +66,7 @@ export default () => {
IconsResolver(),
NaiveUiResolver(),
ElementPlusResolver(),
AntDesignVueResolver(),
VueUseComponentsResolver()
]
}),
Expand Down
6 changes: 4 additions & 2 deletions presets/types/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// Read more: https://github.com/vuejs/vue-next/pull/3399

declare module 'vue' {
export interface GlobalComponents {}
export interface GlobalComponents {
AButton: typeof import('ant-design-vue/es')['Button']
}
}

export {}
export { }

0 comments on commit 9e25dba

Please sign in to comment.