Rating
Introduction
The Rating component is a basic Moflow component used for rating.

Configuration items
Category |
Configuration item |
Example |
Description |
Content |
Default value |
The default rating value. This is an integer. The default step value is 1. |
|
Total |
The number of icons. |
||
Label |
The label. For more information, see Common form properties. |
||
Label configuration |
The label configuration. For more information, see Common form properties. |
||
Interaction |
Hidden |
Hides the component. For more information, see Common properties. |
|
Allow clear on re-click |
Click the selection again to clear it. |
||
Allow partial selection |
Lets you select a half rating. If you enable this option, the step value is 0.5. |
||
Disabled |
Disables interaction with the component. |
||
Validation |
Required |
Validation. For more information, see Common form properties. |
|
Style |
Margin |
The margin. For more information, see Common properties. |
|
Icon type |
Lets you select different icon types. |
||
Note: |
|
Customize the tooltip for each item. |
Properties and methods
Name |
Type |
Example |
Description |
value |
number |
|
The score of the Rating component. |
count |
number |
|
The total number of icons in the Rating component. |
allowClear |
boolean |
|
Read-only. Specifies whether the value of the Rating component can be cleared by clicking the rating again. |
allowHalf |
boolean |
|
Read-only. Specifies whether half-ratings are allowed. |
disabled |
boolean |
|
Specifies whether to disable the Rating component. |
hidden |
boolean |
|
Specifies whether the component is hidden. |
clearCount |
func |
|
Clears the value of the `count` property. |
clearDisabled |
func |
|
Clears the value of the `disabled` property. |
clearHidden |
func |
|
Clears the value of the `hidden` property. |
clearValidate |
func |
|
Clears the validation status of the component. |
clearValue |
func |
|
Clears the value of the `value` property. |
setValue |
func |
|
Sets the rating score. |
setCount |
func |
|
Sets the total number of icons. |
setDisabled |
func |
|
Sets whether the component is disabled. |
setHidden |
func |
|
Sets whether the component is hidden. |
validate |
func |
|
Validates the component. |
validationStatus |
boolean |
|
The validation status of the component. |
validationMessage |
string |
|
The validation message of the component. |
Event callbacks
Configuration item |
Description |
Callback for when the rating value changes. |
|
Callback for when the component gains focus. |
|
Callback for when the value changes on mouse hover. |
|
Callback for when the component loses focus. |
Scenario example
E-commerce order reviews
This is a typical scenario for the Rating component. You can set different review items as needed.

