Rating / 评分

以多个图标展示可互动的评分。

基础的

设置初始值与回调事件。

类型

通过 type 属性展示不同的评分组件。

最大数量

定制图标的最大数量。

图标

以自定义 SVG 图标代替默认的星星图案。

APIs / 接口文档

Rating.Props

属性描述类型推荐值默认
type评分组件类型RatingTypesRatingTypesdefault
icon自定义图标JSX.Element--
count展示图标最大数量numberRatingCount5
value选中值numberRatingValue-
initialValue初始值numberRatingValue1
onValueChange值变化的事件(value?: any) => void--
locked是否锁定boolean-false
onLockedChange锁定变化事件(value?: any) => void--
...原生属性HTMLAttributes--

RatingTypes

type RatingTypes = 'default' | 'secondary' | 'success' | 'warning' | 'error'

RatingCount

type RatingCount = 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10

RatingValue

type RatingValue = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10