[Doc] update README.md and quickstart

This commit is contained in:
陈嘉涵
2019-05-28 10:00:02 +08:00
parent 46a051cb05
commit a4da1c7673
4 changed files with 49 additions and 146 deletions

View File

@@ -29,17 +29,6 @@ npm i vant -S
npm i vant@beta -S
```
### CDN
```html
<!-- import style -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@beta/lib/index.css" />
<!-- import script -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vant@beta/lib/vant.min.js"></script>
```
## Usage
### 1. Import on demand
@@ -102,6 +91,28 @@ Vue.use(Vant);
> If you configured babel-plugin-import, you won't be allowed to import all components.
### 4. CDN
```html
<!-- import style -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@beta/lib/index.css" />
<!-- import script -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vant@beta/lib/vant.min.js"></script>
<script>
var Vue = window.Vue;
var vant = window.vant;
// Register components
Vue.use(vant);
// Call function components
vant.Toast('message');
</script>
```
## Other
### Rem units