diff --git a/packages/rate/en-US.md b/packages/rate/en-US.md index e07c1c80e..c66af3285 100644 --- a/packages/rate/en-US.md +++ b/packages/rate/en-US.md @@ -43,7 +43,7 @@ export default { ``` -### Rate API +### API | Attribute | Description | Type | Default | |-----------|-----------|-----------|-------------| @@ -54,3 +54,9 @@ export default { | void-color | Void color | `String` | `#c7c7c7` | | disabled-color | Disabled color | `String` | `#bdbdbd` | | disabled | Whether to disable rate | `Boolean` | `false` | + +### Event + +| Event | Description | Parameters | +|-----------|-----------|-----------| +| change | Triggered when rate changed | current rate | diff --git a/packages/rate/index.vue b/packages/rate/index.vue index 03914281b..52a84f6d6 100644 --- a/packages/rate/index.vue +++ b/packages/rate/index.vue @@ -66,6 +66,7 @@ export default create({ onSelect(index) { if (!this.disabled) { this.$emit('input', index + 1); + this.$emit('change', index + 1); } } } diff --git a/packages/rate/zh-CN.md b/packages/rate/zh-CN.md index 80e0272ee..1eb30d2bc 100644 --- a/packages/rate/zh-CN.md +++ b/packages/rate/zh-CN.md @@ -43,7 +43,7 @@ export default { ``` -### Rate API +### API | 参数 | 说明 | 类型 | 默认值 | |-----------|-----------|-----------|-------------| @@ -54,3 +54,9 @@ export default { | void-color | 未选中时的颜色 | `String` | `#c7c7c7` | | disabled-color | 不可选时的颜色 | `String` | `#bdbdbd` | | disabled | 是否禁用评分 | `Boolean` | `false` | + +### Event + +| 事件名称 | 说明 | 回调参数 | +|-----------|-----------|-----------| +| change | 当前分值变化时触发的事件 | 当前分值 |