2016-03-31 14:17:09 +08:00
|
|
|
---
|
|
|
|
category: Components
|
2016-07-21 10:10:04 +08:00
|
|
|
subtitle: 评分
|
2016-11-09 14:43:32 +08:00
|
|
|
type: Data Entry
|
2016-07-21 10:10:04 +08:00
|
|
|
title: Rate
|
2016-03-31 14:17:09 +08:00
|
|
|
---
|
2016-03-30 13:20:03 +08:00
|
|
|
|
|
|
|
评分组件。
|
|
|
|
|
2016-03-31 14:43:38 +08:00
|
|
|
## 何时使用
|
|
|
|
|
|
|
|
- 对评价进行展示。
|
2016-04-05 19:14:21 +08:00
|
|
|
- 对事物进行快速的评级操作。
|
2016-03-30 13:20:03 +08:00
|
|
|
|
2016-03-31 14:43:38 +08:00
|
|
|
## API
|
2016-03-30 13:20:03 +08:00
|
|
|
|
2017-10-25 10:25:44 +08:00
|
|
|
| 属性 | 说明 | 类型 | 默认值 |
|
|
|
|
| --- | --- | --- | --- |
|
|
|
|
| allowHalf | 是否允许半选 | boolean | false |
|
2017-03-06 14:23:38 +08:00
|
|
|
| character | 自定义字符 | ReactNode | `<Icon type="star" />` |
|
2017-02-21 14:44:13 +08:00
|
|
|
| className | 自定义样式类名 | string | - |
|
2017-10-25 10:25:44 +08:00
|
|
|
| count | star 总数 | number | 5 |
|
|
|
|
| defaultValue | 默认值 | number | 0 |
|
|
|
|
| disabled | 只读,无法进行交互 | boolean | false |
|
2017-02-21 14:44:13 +08:00
|
|
|
| style | 自定义样式对象 | object | - |
|
2017-10-25 10:25:44 +08:00
|
|
|
| value | 当前数,受控值 | number | - |
|
2017-11-28 10:48:58 +08:00
|
|
|
| onBlur | 失去焦点时的回调 | Function() | - |
|
2017-10-25 10:25:44 +08:00
|
|
|
| onChange | 选择时的回调 | Function(value: number) | - |
|
2017-11-28 10:48:58 +08:00
|
|
|
| onFocus | 获取焦点时的回调 | Function() | - |
|
2017-10-25 10:25:44 +08:00
|
|
|
| onHoverChange | 鼠标经过时数值变化的回调 | Function(value: number) | - |
|
2017-11-28 10:48:58 +08:00
|
|
|
| onKeyDown | 按键回调 | Function(event) | - |
|