[Improvement] Reorganize document (#1066)

This commit is contained in:
neverland
2018-05-15 10:39:01 +08:00
committed by GitHub
parent b1142fd862
commit e8aad7246c
124 changed files with 181 additions and 186 deletions
+56
View File
@@ -0,0 +1,56 @@
## Rate
### Install
``` javascript
import { Rate } from 'vant';
Vue.use(Rate);
```
### Usage
#### Basic Usage
```html
<van-rate v-model="value" />
```
```javascript
export default {
data() {
return {
value: 3
};
}
}
```
#### Custom Color
```html
<van-rate
v-model="value"
:size="25"
:count="6"
color="#2ba"
void-color="#ceefe8"
/>
```
#### Disabled
```html
<van-rate v-model="value" disabled />
```
### Rate API
| Attribute | Description | Type | Default |
|-----------|-----------|-----------|-------------|
| v-model | Current rate | `Number` | - |
| count | Count | `Number` | `5` |
| size | Icon size (px) | `Number` | `20` |
| color | Selected color | `String` | `#ffd21e` |
| void-color | Void color | `String` | `#c7c7c7` |
| disabled-color | Disabled color | `String` | `#bdbdbd` |
| disabled | Whether to disable rate | `Boolean` | `false` |
+56
View File
@@ -0,0 +1,56 @@
## Rate 评分
### 使用指南
``` javascript
import { Rate } from 'vant';
Vue.use(Rate);
```
### 代码演示
#### 基础用法
```html
<van-rate v-model="value" />
```
```javascript
export default {
data() {
return {
value: 3
};
}
}
```
#### 自定义颜色
```html
<van-rate
v-model="value"
:size="25"
:count="6"
color="#2ba"
void-color="#ceefe8"
/>
```
#### 禁用状态
```html
<van-rate v-model="value" disabled />
```
### Rate API
| 参数 | 说明 | 类型 | 默认值 |
|-----------|-----------|-----------|-------------|
| v-model | 当前分值 | `Number` | - |
| count | 图标总数 | `Number` | `5` |
| size | 图标大小 (px) | `Number` | `20` |
| color | 选中时的颜色 | `String` | `#ffd21e` |
| void-color | 未选中时的颜色 | `String` | `#c7c7c7` |
| disabled-color | 不可选时的颜色 | `String` | `#bdbdbd` |
| disabled | 是否禁用评分 | `Boolean` | `false` |