Skip to content

RatingControl-DEMO


vue
<fv-RatingControl value="3">
</fv-RatingControl>

RatingControl-Half Rate


vue
<fv-RatingControl value="2.5" :halfRate="true">
</fv-RatingControl>

with Hover Title

2.5

vue
<fv-RatingControl v-model="value" :halfRate="true" @hover="hoverValue">
</fv-RatingControl>

<script>
export default {

    data () {
        return {
            value: 2.5
        }
    },
    methods: {
        hoverValue (target) {
            this.value = target.index + (target.ratio > 50 ? 0.5 : 0);
        }
    }
}
</script>

RatingControl-Clearable


vue
<fv-RatingControl value="2.5" :halfRate="true" :isClear="true">
</fv-RatingControl>

RatingControl-Readonly


vue
<fv-RatingControl value="3.5" :halfRate="true" :isClear="true" readonly>
</fv-RatingControl>

RatingControl-Customize


vue
<fv-RatingControl value="1.5" defaultIcon="Heart" selectedIcon="HeartFill" borderColor="rgba(200, 200, 200, 1)" selectedColor="rgba(173, 38, 45, 1)" :halfRate="true" :isClear="true">
</fv-RatingControl>

Properties


PropertyTypeRequiredDefaultDescription
modelValuenumberNo0See the RatingControl modelValue option.
maxRatenumberNo5See the RatingControl maxRate option.
halfRatebooleanNofalseSee the RatingControl halfRate option.
defaultIconstringNo'FavoriteStar'See the RatingControl defaultIcon option.
selectedIconstringNo'FavoriteStarFill'See the RatingControl selectedIcon option.
borderColorstringNo''Border color.
selectedColorstringNo''See the RatingControl selectedColor option.
isClearbooleanNofalseSee the RatingControl isClear option.
readonlybooleanNofalseSee the RatingControl readonly option.
themestringNo'global'Theme color.
disabledbooleanNofalseSee the RatingControl disabled option.
langstringNo"global"See the RatingControl lang option.

Events


EventArgumentsDescription
changeNumberSee the component change option.
hoverObjectSee the component hover option.
leaveNumberSee the component leave option.

MIT Licensed