From 95ce5f4eb113b49f8c7ec69a7b27d88e37ba96ee Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 25 Jan 2022 09:38:36 +0800 Subject: [PATCH] doc: update doc --- site/src/vueDocs/getting-started.en-US.md | 9 +++++---- site/src/vueDocs/getting-started.zh-CN.md | 11 ++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/site/src/vueDocs/getting-started.en-US.md b/site/src/vueDocs/getting-started.en-US.md index bd346e893..68cb5296e 100644 --- a/site/src/vueDocs/getting-started.en-US.md +++ b/site/src/vueDocs/getting-started.en-US.md @@ -46,9 +46,9 @@ import Antd from 'ant-design-vue'; import App from './App'; import 'ant-design-vue/dist/antd.css'; -const app = createApp(); +const app = createApp(App); -app.use(Antd); +app.use(Antd).mount('#app'); ``` The above imports Antd entirely. Note that CSS file needs to be imported separately. @@ -104,9 +104,10 @@ And this plugin can load styles too, read [usage](https://github.com/ant-design/ > 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. 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: + ```ts -import { message } from "ant-design-vue" -import "ant-design-vue/es/message/style/css" //use ant-design-vue/es instead of ant-design-vue/lib +import { message } from 'ant-design-vue'; +import 'ant-design-vue/es/message/style/css'; //use ant-design-vue/es instead of ant-design-vue/lib ``` ## Customization diff --git a/site/src/vueDocs/getting-started.zh-CN.md b/site/src/vueDocs/getting-started.zh-CN.md index b45f72ad2..edffd1536 100644 --- a/site/src/vueDocs/getting-started.zh-CN.md +++ b/site/src/vueDocs/getting-started.zh-CN.md @@ -48,9 +48,9 @@ import Antd from 'ant-design-vue'; import App from './App'; import 'ant-design-vue/dist/antd.css'; -const app = createApp(); +const app = createApp(App); -app.use(Antd); +app.use(Antd).mount('#app'); ``` 以上代码便完成了 Antd 的引入。需要注意的是,样式文件需要单独引入。 @@ -74,7 +74,7 @@ app.config.globalProperties.$message = message; ## 兼容性 -Ant Design Vue 2.x 支持所有的现代浏览器。 +Ant Design Vue 2.x+ 支持所有的现代浏览器。 如果需要支持 IE9+,你可以使用 Ant Design Vue 1.x & Vue 2.x。 @@ -104,9 +104,10 @@ import { Button } from 'ant-design-vue'; > 注意,babel-plugin-import 的 `style` 属性除了引入对应组件的样式,也会引入一些必要的全局样式。如果你不需要它们,建议不要使用此属性。你可以 `import 'ant-design-vue/dist/antd.css` 手动引入,并覆盖全局样式。 如果你使用的 Vite,你可以使用 [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components) 来进行按需加载。但是此插件无法处理非组件模块,如 message,这种组件需要手动加载: + ```ts -import { message } from "ant-design-vue" -import "ant-design-vue/es/message/style/css" //vite只能用 ant-design-vue/es 而非 ant-design-vue/lib +import { message } from 'ant-design-vue'; +import 'ant-design-vue/es/message/style/css'; //vite只能用 ant-design-vue/es 而非 ant-design-vue/lib ``` ## 配置主题和字体