Skip to content

Commit 7624d80

Browse files
authored
doc: add usage for vite (#5176), close #5169
1 parent 62428b6 commit 7624d80

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

site/src/vueDocs/getting-started.en-US.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ And this plugin can load styles too, read [usage](https://github.com/ant-design/
103103

104104
> FYI, babel-plugin-import's `style` option will importing some global reset styles, don't use it if you don't need those styles. You can import styles manually via `import 'ant-design-vue/dist/antd.css'` and override the global reset styles.
105105
106-
If you use Vite, you can use [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components) to load on demand.
106+
If you use Vite, you can use [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components) to load on demand. However, this plugin can only deal with components. Others such as message should be loaded manually:
107+
```ts
108+
import { message } from "ant-design-vue"
109+
import "ant-design-vue/es/message/style/css" //use ant-design-vue/es instead of ant-design-vue/lib
110+
```
107111
108112
## Customization
109113

site/src/vueDocs/getting-started.zh-CN.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ import { Button } from 'ant-design-vue';
103103

104104
> 注意,babel-plugin-import 的 `style` 属性除了引入对应组件的样式,也会引入一些必要的全局样式。如果你不需要它们,建议不要使用此属性。你可以 `import 'ant-design-vue/dist/antd.css` 手动引入,并覆盖全局样式。
105105
106-
如果你使用的 Vite,你可以使用 [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components) 来进行按需加载
106+
如果你使用的 Vite,你可以使用 [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components) 来进行按需加载。但是此插件无法处理非组件模块,如 message,这种组件需要手动加载:
107+
```ts
108+
import { message } from "ant-design-vue"
109+
import "ant-design-vue/es/message/style/css" //vite只能用 ant-design-vue/es 而非 ant-design-vue/lib
110+
```
107111
108112
## 配置主题和字体
109113

0 commit comments

Comments
 (0)