[improvement] Checkbox: add checked-color prop (#2057)

This commit is contained in:
neverland
2018-11-08 22:58:55 +08:00
committed by GitHub
parent b5cdfc3ac5
commit f272f661b3
5 changed files with 82 additions and 28 deletions
+10 -1
View File
@@ -31,7 +31,14 @@ export default {
<van-checkbox v-model="checked" disabled>Checkbox</van-checkbox>
```
#### Custom Color
```html
<van-checkbox v-model="checked" checked-color="#4b0">Checkbox</van-checkbox>
```
#### Custom Icon
Use icon slot to custom icon
```html
@@ -58,6 +65,7 @@ export default {
```
#### Checkbox Group
When Checkboxes are inside a CheckboxGroup, the checked checkboxes's name is an array and bound with CheckboxGroup by v-model.
```html
@@ -131,11 +139,12 @@ export default {
| Attribute | Description | Type | Default |
|------|------|------|------|
| name | Checkbox name | `any` | - |
| shape | Can be set to `round` `square` | `String` | `round` |
| v-model | Check status | `Boolean` | `false` |
| disabled | Diable checkbox | `Boolean` | `false` |
| label-disabled | Whether to disable label click | `Boolean` | `false` |
| label-position | Can be set to `left` | `String` | `right` |
| shape | Can be set to `round` `square` | `String` | `round` |
| checked-color | Checked color | `String` | `#1989fa` | - |
### CheckboxGroup API