[new feature] SwitchCell: add active-color & inactive-color prop (#2273)

This commit is contained in:
neverland 2018-12-12 15:52:04 +08:00 committed by GitHub
parent cac7e0beff
commit a4a2ce9635
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -57,9 +57,11 @@ use `loading` property to keep component in loading state
| loading | whether switch is loading | `Boolean` | `false` |
| disabled | whether to disable switch | `Boolean` | `false` |
| size | Size of switch | `String` | `24px` |
| active-color | Background of switch color when active | `String` | `#1989fa` |
| inactive-color | Background of switch color when inactive | `String` | `#fff` |
### Event
| Event | Description | Arguments |
|------|------|------|
| change | triggered when the on-off state is changed | checked: switch is on or not |
| change | triggered when the on-off state is changed | checked: switch is on or not |

View File

@ -29,6 +29,8 @@ export default create({
border: Boolean,
loading: Boolean,
disabled: Boolean,
activeColor: String,
inactiveColor: String,
size: {
type: String,
default: '24px'

View File

@ -57,6 +57,8 @@ export default {
| loading | 是否为加载状态 | `Boolean` | `false` | - |
| disabled | 是否为禁用状态 | `Boolean` | `false` | - |
| size | 开关尺寸 | `String` | `24px` | 1.1.11 |
| active-color | 开关时的背景色 | `String` | `#1989fa` | 1.4.10 |
| inactive-color | 开关时的背景色 | `String` | `#fff` | 1.4.10 |
### Event