[improvement] Switch: add active-color prop (#2013)

This commit is contained in:
neverland
2018-11-01 19:56:09 +08:00
committed by GitHub
parent af168d6abc
commit 42f985cd7b
9 changed files with 43 additions and 17 deletions

View File

@@ -23,6 +23,8 @@ export default create({
value: Boolean,
loading: Boolean,
disabled: Boolean,
activeColor: String,
inactiveColor: String,
size: {
type: String,
default: '30px'
@@ -32,7 +34,8 @@ export default create({
computed: {
style() {
return {
fontSize: this.size
fontSize: this.size,
backgroundColor: this.value ? this.activeColor : this.inactiveColor
};
}
},