docs: prettier all markdown files
This commit is contained in:
+30
-39
@@ -21,20 +21,16 @@ Vue.use(Rate);
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: 3
|
||||
value: 3,
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### Custom Icon
|
||||
|
||||
```html
|
||||
<van-rate
|
||||
v-model="value"
|
||||
icon="like"
|
||||
void-icon="like-o"
|
||||
/>
|
||||
<van-rate v-model="value" icon="like" void-icon="like-o" />
|
||||
```
|
||||
|
||||
### Custom Style
|
||||
@@ -52,22 +48,17 @@ export default {
|
||||
### Half Star
|
||||
|
||||
```html
|
||||
<van-rate
|
||||
v-model="value"
|
||||
allow-half
|
||||
void-icon="star"
|
||||
void-color="#eee"
|
||||
/>
|
||||
<van-rate v-model="value" allow-half void-icon="star" void-color="#eee" />
|
||||
```
|
||||
|
||||
```js
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: 2.5
|
||||
value: 2.5,
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### Custom Count
|
||||
@@ -79,7 +70,7 @@ export default {
|
||||
### Disabled
|
||||
|
||||
```html
|
||||
<van-rate v-model="value" disabled />
|
||||
<van-rate v-model="value" disabled />
|
||||
```
|
||||
|
||||
### Readonly
|
||||
@@ -98,10 +89,10 @@ export default {
|
||||
export default {
|
||||
method: {
|
||||
onChange(value) {
|
||||
Toast('current value:'+ value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Toast('current value:' + value);
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
## API
|
||||
@@ -109,24 +100,24 @@ export default {
|
||||
### Props
|
||||
|
||||
| Attribute | Description | Type | Default |
|
||||
|------|------|------|------|
|
||||
| v-model | Current rate | *number* | - |
|
||||
| count | Count | *number \| string* | `5` |
|
||||
| size | Icon size| *number \| string* | `20px` |
|
||||
| gutter | Icon gutter | *number \| string* | `4px` |
|
||||
| color | Selected color | *string* | `#ffd21e` |
|
||||
| void-color | Void color | *string* | `#c8c9cc` |
|
||||
| disabled-color | Disabled color | *string* | `#bdbdbd` |
|
||||
| icon | Selected icon | *string* | `star` |
|
||||
| void-icon | Void icon | *string* | `star-o` |
|
||||
| icon-prefix `v2.5.3` | Icon className prefix | *string* | `van-icon` |
|
||||
| allow-half | Whether to allow half star | *boolean* | `false` |
|
||||
| readonly | Whether to be readonly | *boolean* | `false` |
|
||||
| disabled | Whether to disable rate | *boolean* | `false` |
|
||||
| touchable `v2.2.0` | Whether to allow select rate by touch gesture | *boolean* | `true` |
|
||||
| --- | --- | --- | --- |
|
||||
| v-model | Current rate | _number_ | - |
|
||||
| count | Count | _number \| string_ | `5` |
|
||||
| size | Icon size | _number \| string_ | `20px` |
|
||||
| gutter | Icon gutter | _number \| string_ | `4px` |
|
||||
| color | Selected color | _string_ | `#ffd21e` |
|
||||
| void-color | Void color | _string_ | `#c8c9cc` |
|
||||
| disabled-color | Disabled color | _string_ | `#bdbdbd` |
|
||||
| icon | Selected icon | _string_ | `star` |
|
||||
| void-icon | Void icon | _string_ | `star-o` |
|
||||
| icon-prefix `v2.5.3` | Icon className prefix | _string_ | `van-icon` |
|
||||
| allow-half | Whether to allow half star | _boolean_ | `false` |
|
||||
| readonly | Whether to be readonly | _boolean_ | `false` |
|
||||
| disabled | Whether to disable rate | _boolean_ | `false` |
|
||||
| touchable `v2.2.0` | Whether to allow select rate by touch gesture | _boolean_ | `true` |
|
||||
|
||||
### Events
|
||||
|
||||
| Event | Description | Parameters |
|
||||
|------|------|------|
|
||||
| Event | Description | Parameters |
|
||||
| ------ | --------------------------- | ------------ |
|
||||
| change | Triggered when rate changed | current rate |
|
||||
|
||||
+29
-38
@@ -21,20 +21,16 @@ Vue.use(Rate);
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: 3
|
||||
value: 3,
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### 自定义图标
|
||||
|
||||
```html
|
||||
<van-rate
|
||||
v-model="value"
|
||||
icon="like"
|
||||
void-icon="like-o"
|
||||
/>
|
||||
<van-rate v-model="value" icon="like" void-icon="like-o" />
|
||||
```
|
||||
|
||||
### 自定义样式
|
||||
@@ -52,22 +48,17 @@ export default {
|
||||
### 半星
|
||||
|
||||
```html
|
||||
<van-rate
|
||||
v-model="value"
|
||||
allow-half
|
||||
void-icon="star"
|
||||
void-color="#eee"
|
||||
/>
|
||||
<van-rate v-model="value" allow-half void-icon="star" void-color="#eee" />
|
||||
```
|
||||
|
||||
```js
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: 2.5
|
||||
value: 2.5,
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### 自定义数量
|
||||
@@ -98,10 +89,10 @@ export default {
|
||||
export default {
|
||||
method: {
|
||||
onChange(value) {
|
||||
Toast('当前值:'+ value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Toast('当前值:' + value);
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
## API
|
||||
@@ -109,24 +100,24 @@ export default {
|
||||
### Props
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------|------|------|------|
|
||||
| v-model | 当前分值 | *number* | - |
|
||||
| count | 图标总数 | *number \| string* | `5` |
|
||||
| size | 图标大小,默认单位为`px` | *number \| string* | `20px` |
|
||||
| gutter | 图标间距,默认单位为`px` | *number \| string* | `4px` |
|
||||
| color | 选中时的颜色 | *string* | `#ffd21e` |
|
||||
| void-color | 未选中时的颜色 | *string* | `#c8c9cc` |
|
||||
| disabled-color | 禁用时的颜色 | *string* | `#bdbdbd` |
|
||||
| icon | 选中时的[图标名称](#/zh-CN/icon)或图片链接 | *string* | `star` |
|
||||
| void-icon | 未选中时的[图标名称](#/zh-CN/icon)或图片链接 | *string* | `star-o` |
|
||||
| icon-prefix `v2.5.3` | 图标类名前缀,同 Icon 组件的 [class-prefix 属性](#/zh-CN/icon#props) | *string* | `van-icon` |
|
||||
| allow-half | 是否允许半选 | *boolean* | `false` |
|
||||
| readonly | 是否为只读状态 | *boolean* | `false` |
|
||||
| disabled | 是否禁用评分 | *boolean* | `false` |
|
||||
| touchable `v2.2.0` | 是否可以通过滑动手势选择评分 | *boolean* | `true` |
|
||||
| --- | --- | --- | --- |
|
||||
| v-model | 当前分值 | _number_ | - |
|
||||
| count | 图标总数 | _number \| string_ | `5` |
|
||||
| size | 图标大小,默认单位为`px` | _number \| string_ | `20px` |
|
||||
| gutter | 图标间距,默认单位为`px` | _number \| string_ | `4px` |
|
||||
| color | 选中时的颜色 | _string_ | `#ffd21e` |
|
||||
| void-color | 未选中时的颜色 | _string_ | `#c8c9cc` |
|
||||
| disabled-color | 禁用时的颜色 | _string_ | `#bdbdbd` |
|
||||
| icon | 选中时的[图标名称](#/zh-CN/icon)或图片链接 | _string_ | `star` |
|
||||
| void-icon | 未选中时的[图标名称](#/zh-CN/icon)或图片链接 | _string_ | `star-o` |
|
||||
| icon-prefix `v2.5.3` | 图标类名前缀,同 Icon 组件的 [class-prefix 属性](#/zh-CN/icon#props) | _string_ | `van-icon` |
|
||||
| allow-half | 是否允许半选 | _boolean_ | `false` |
|
||||
| readonly | 是否为只读状态 | _boolean_ | `false` |
|
||||
| disabled | 是否禁用评分 | _boolean_ | `false` |
|
||||
| touchable `v2.2.0` | 是否可以通过滑动手势选择评分 | _boolean_ | `true` |
|
||||
|
||||
### Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
|------|------|------|
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | ------------------------ | -------- |
|
||||
| change | 当前分值变化时触发的事件 | 当前分值 |
|
||||
|
||||
Reference in New Issue
Block a user