# Rate ### Install ```js import Vue from 'vue'; import { Rate } from 'vant'; Vue.use(Rate); ``` ## Usage ### Basic Usage ```html ``` ```js export default { data() { return { value: 3, }; }, }; ``` ### Custom Icon ```html ``` ### Custom Style ```html ``` ### Half Star ```html ``` ```js export default { data() { return { value: 2.5, }; }, }; ``` ### Custom Count ```html ``` ### Disabled ```html ``` ### Readonly ```html ``` ### Change Event ```html ``` ```javascript export default { method: { onChange(value) { Toast('current value:' + value); }, }, }; ``` ## API ### Props | Attribute | Description | Type | Default | | --- | --- | --- | --- | | v-model | Current rate | _number_ | - | | count | Count | _number \| string_ | `5` | | size | Icon size | _number \| string_ | `20px` | | gutter | Icon gutter | _number \| string_ | `4px` | | color | Selected color | _string_ | `#ee0a24` | | void-color | Void color | _string_ | `#c8c9cc` | | disabled-color | Disabled color | _string_ | `#c8c9cc` | | icon | Selected icon | _string_ | `star` | | void-icon | Void icon | _string_ | `star-o` | | icon-prefix `v2.5.3` | Icon className prefix | _string_ | `van-icon` | | allow-half | Whether to allow half star | _boolean_ | `false` | | readonly | Whether to be readonly | _boolean_ | `false` | | disabled | Whether to disable rate | _boolean_ | `false` | | touchable | Whether to allow select rate by touch gesture | _boolean_ | `true` | ### Events | Event | Description | Parameters | | ------ | ------------------------- | ------------ | | change | Emitted when rate changed | current rate |