From 435c6ee794b1ccfa69710d9cafbda3d8d975d257 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Fri, 21 Aug 2020 11:42:40 +0800 Subject: [PATCH] docs: update install guide --- README.md | 3 ++- README.zh-CN.md | 3 ++- docs/markdown/quickstart.en-US.md | 5 +++-- docs/markdown/quickstart.zh-CN.md | 5 +++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bb73583e3..b2b2b0b40 100644 --- a/README.md +++ b/README.md @@ -54,10 +54,11 @@ yarn add vant ## Quickstart ```js -import Vue from 'vue'; +import { createApp } from 'vue'; import { Button } from 'vant'; import 'vant/lib/index.css'; +const app = createApp(); Vue.use(Button); ``` diff --git a/README.zh-CN.md b/README.zh-CN.md index f39e36e19..84ba1a259 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -51,10 +51,11 @@ yarn add vant ## 快速上手 ```js -import Vue from 'vue'; +import { createApp } from 'vue'; import { Button } from 'vant'; import 'vant/lib/index.css'; +const app = createApp(); Vue.use(Button); ``` diff --git a/docs/markdown/quickstart.en-US.md b/docs/markdown/quickstart.en-US.md index f86b090df..c7ca764cf 100644 --- a/docs/markdown/quickstart.en-US.md +++ b/docs/markdown/quickstart.en-US.md @@ -82,11 +82,12 @@ import 'vant/lib/button/style'; ### 3. Import all components ```js -import Vue from 'vue'; +import { createApp } from 'vue'; import Vant from 'vant'; import 'vant/lib/index.css'; -Vue.use(Vant); +const app = createApp(); +app.use(Vant); ``` > If you configured babel-plugin-import, you won't be allowed to import all components. diff --git a/docs/markdown/quickstart.zh-CN.md b/docs/markdown/quickstart.zh-CN.md index 3c30beef9..781247d23 100644 --- a/docs/markdown/quickstart.zh-CN.md +++ b/docs/markdown/quickstart.zh-CN.md @@ -99,11 +99,12 @@ import 'vant/lib/button/style'; Vant 支持一次性导入所有组件,引入所有组件会增加代码包体积,因此不推荐这种做法 ```js -import Vue from 'vue'; +import { createApp } from 'vue'; import Vant from 'vant'; import 'vant/lib/index.css'; -Vue.use(Vant); +const app = createApp(); +app.use(Vant); ``` > 配置按需引入后,将不允许直接导入所有组件