[Doc]: add CDN link

This commit is contained in:
陈嘉涵
2017-10-20 11:22:22 +08:00
parent a2f4a4ed83
commit 45e134fa7e
5 changed files with 26 additions and 76 deletions

View File

@@ -15,43 +15,8 @@
npm i -S vant
```
## 二、使用
### 使用 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) (推荐)
```js
// .babelrc or babel-loader option
{
"plugins": [
["import", { "libraryName": "vant", "style": true }]
]
}
```
  接着你可以直接引入 vant 组件,等价于下方的按需引入组件
```js
  // 模块化地引入 js 和 css, 通过 babel-plugin-import 插件解析
  import { Button } from 'vant';
```
### 按需引入组件
```jsx
import { Button } from 'vant/lib/button';
import 'vant/lib/vant-css/button.css';
```
### 导入所有组件
```javascript
import Vue from 'vue';
import vant from 'vant';
import 'vant/lib/vant-css/index.css';
Vue.use(vant);
```
## 二、快速上手
参考 [Quickstart](https://www.youzanyun.com/zanui/vue#/zh-CN/component/quickstart).
## 三、贡献代码