vant/docs/examples-docs/quickstart.md
张敏 0f5972e75e 支持SSR、升级Vue版本和增加新的icon (#40)
* search component add new style

* update vue version and support ssr

* unit test

* add new icon

* new icon
2017-06-15 19:46:56 +08:00

57 lines
999 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## Vant
一套基于`Vue.js 2.0`的Mobile组件库
<br>A Vue.js 2.0 Mobile UI
### 安装
```shell
npm i vant -S
```
### 引入组件
#### 完整引入
```javascript
import Vue from 'vue';
import ZanUI from 'vant';
import 'vant/lib/vant-css/index.css';
Vue.use(ZanUI);
```
#### 按需引入
```javascript
import Vue from 'vue';
import { Button, Cell } from 'vant';
import 'vant/lib/vant-css/button.css';
import 'vant/lib/vant-css/cell.css';
Vue.component(Button.name, Button);
Vue.component(Cell.name, Cell);
```
### 自定义主题
`Vant`默认提供一套主题,`CSS`命名采用`BEM`的风格方便使用者覆盖样式。如果你想完全替换主题色或者部分样式,可以使用下面的方法:
#### 下载主题
可以通过Github或npm来下载主题
```shell
# npm
npm i vant-css -D
# github
git clone git@github.com:youzan/vant.git
cd packages/vant-css
```
#### 修改主题
修改你下载主题对应的样式即可,然后引入你修改后的主题。