mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[Improvement] Rate: add change event (#1102)
This commit is contained in:
parent
9bafa62ba4
commit
86a2569614
@ -43,7 +43,7 @@ export default {
|
|||||||
<van-rate v-model="value" disabled />
|
<van-rate v-model="value" disabled />
|
||||||
```
|
```
|
||||||
|
|
||||||
### Rate API
|
### API
|
||||||
|
|
||||||
| Attribute | Description | Type | Default |
|
| Attribute | Description | Type | Default |
|
||||||
|-----------|-----------|-----------|-------------|
|
|-----------|-----------|-----------|-------------|
|
||||||
@ -54,3 +54,9 @@ export default {
|
|||||||
| void-color | Void color | `String` | `#c7c7c7` |
|
| void-color | Void color | `String` | `#c7c7c7` |
|
||||||
| disabled-color | Disabled color | `String` | `#bdbdbd` |
|
| disabled-color | Disabled color | `String` | `#bdbdbd` |
|
||||||
| disabled | Whether to disable rate | `Boolean` | `false` |
|
| disabled | Whether to disable rate | `Boolean` | `false` |
|
||||||
|
|
||||||
|
### Event
|
||||||
|
|
||||||
|
| Event | Description | Parameters |
|
||||||
|
|-----------|-----------|-----------|
|
||||||
|
| change | Triggered when rate changed | current rate |
|
||||||
|
@ -66,6 +66,7 @@ export default create({
|
|||||||
onSelect(index) {
|
onSelect(index) {
|
||||||
if (!this.disabled) {
|
if (!this.disabled) {
|
||||||
this.$emit('input', index + 1);
|
this.$emit('input', index + 1);
|
||||||
|
this.$emit('change', index + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ export default {
|
|||||||
<van-rate v-model="value" disabled />
|
<van-rate v-model="value" disabled />
|
||||||
```
|
```
|
||||||
|
|
||||||
### Rate API
|
### API
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 |
|
||||||
|-----------|-----------|-----------|-------------|
|
|-----------|-----------|-----------|-------------|
|
||||||
@ -54,3 +54,9 @@ export default {
|
|||||||
| void-color | 未选中时的颜色 | `String` | `#c7c7c7` |
|
| void-color | 未选中时的颜色 | `String` | `#c7c7c7` |
|
||||||
| disabled-color | 不可选时的颜色 | `String` | `#bdbdbd` |
|
| disabled-color | 不可选时的颜色 | `String` | `#bdbdbd` |
|
||||||
| disabled | 是否禁用评分 | `Boolean` | `false` |
|
| disabled | 是否禁用评分 | `Boolean` | `false` |
|
||||||
|
|
||||||
|
### Event
|
||||||
|
|
||||||
|
| 事件名称 | 说明 | 回调参数 |
|
||||||
|
|-----------|-----------|-----------|
|
||||||
|
| change | 当前分值变化时触发的事件 | 当前分值 |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user