[new feature] Rate: add allow-half prop (#3134)
This commit is contained in:
+37
-3
@@ -41,18 +41,51 @@ export default {
|
||||
<van-rate
|
||||
v-model="value"
|
||||
:size="25"
|
||||
:count="6"
|
||||
color="#07c160"
|
||||
void-color="#ceefe8"
|
||||
color="#f44"
|
||||
void-icon="star"
|
||||
void-color="#eee"
|
||||
/>
|
||||
```
|
||||
|
||||
#### Half Star
|
||||
|
||||
```html
|
||||
<van-rate
|
||||
v-model="value"
|
||||
allow-half
|
||||
void-icon="star"
|
||||
void-color="#eee"
|
||||
/>
|
||||
```
|
||||
|
||||
```javascript
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: 2.5
|
||||
};
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Custom Count
|
||||
|
||||
```html
|
||||
<van-rate v-model="value" :count="6" />
|
||||
```
|
||||
|
||||
#### Disabled
|
||||
|
||||
```html
|
||||
<van-rate v-model="value" disabled />
|
||||
```
|
||||
|
||||
#### Readonly
|
||||
|
||||
```html
|
||||
<van-rate v-model="value" readonly />
|
||||
```
|
||||
|
||||
### API
|
||||
|
||||
| Attribute | Description | Type | Default |
|
||||
@@ -64,6 +97,7 @@ export default {
|
||||
| void-color | Void color | `String` | `#c7c7c7` |
|
||||
| icon | Selected icon | `String` | `star` |
|
||||
| void-icon | Void icon | `String` | `star-o` |
|
||||
| allow-half | Whether to allow half star | `Boolean` | `false` |
|
||||
| readonly | Whether to be readonly | `Boolean` | `false` |
|
||||
| disabled | Whether to disable rate | `Boolean` | `false` |
|
||||
| disabled-color | Disabled color | `String` | `#bdbdbd` |
|
||||
|
||||
Reference in New Issue
Block a user