@@ -33,7 +33,7 @@ const constants = {
33
33
width: 50 ,
34
34
height: 22 ,
35
35
margin: 3 ,
36
- buttonBackground : ' #fff'
36
+ switchColor : ' #fff'
37
37
}
38
38
39
39
const contains = (object , title ) => {
@@ -69,7 +69,7 @@ export default {
69
69
: typeof value === ' string'
70
70
}
71
71
},
72
- buttonBackground : {
72
+ switchColor : {
73
73
type: [String , Object ],
74
74
validator (value ) {
75
75
return typeof value === ' object'
@@ -135,7 +135,7 @@ export default {
135
135
transform: this .toggled
136
136
? ` translate3d(${ this .distance } , 3px, 0px)`
137
137
: null ,
138
- background: this .buttonBackground ? this .buttonBackgroundCurrent : undefined
138
+ background: this .switchColor ? this .switchColorCurrent : undefined
139
139
}
140
140
},
141
141
@@ -183,32 +183,32 @@ export default {
183
183
: constants .labelUnchecked
184
184
},
185
185
186
- buttonBackgroundChecked () {
187
- let { buttonBackground } = this
186
+ switchColorChecked () {
187
+ let { switchColor } = this
188
188
189
- return contains (buttonBackground , ' checked' )
190
- ? buttonBackground .checked
191
- : constants .buttonBackground
189
+ return contains (switchColor , ' checked' )
190
+ ? switchColor .checked
191
+ : constants .switchColor
192
192
},
193
193
194
- buttonBackgroundUnchecked () {
195
- let { buttonBackground } = this
194
+ switchColorUnchecked () {
195
+ let { switchColor } = this
196
196
197
- return contains (buttonBackground , ' unchecked' )
198
- ? buttonBackground .unchecked
199
- : constants .buttonBackground
197
+ return contains (switchColor , ' unchecked' )
198
+ ? switchColor .unchecked
199
+ : constants .switchColor
200
200
},
201
201
202
- buttonBackgroundCurrent () {
203
- let { buttonBackground } = this
202
+ switchColorCurrent () {
203
+ let { switchColor } = this
204
204
205
- if (typeof buttonBackground !== ' object' ) {
206
- return buttonBackground || constants .buttonBackground
205
+ if (typeof switchColor !== ' object' ) {
206
+ return switchColor || constants .switchColor
207
207
}
208
208
209
209
return this .toggled
210
- ? this .buttonBackgroundChecked
211
- : this .buttonBackgroundUnchecked
210
+ ? this .switchColorChecked
211
+ : this .switchColorUnchecked
212
212
}
213
213
214
214
},
0 commit comments