euvl/vue-js-toggle-button

object type color property not work

mikeda37 opened this issue · 5 comments

Hi,
The object-type color property looks like not working.
Example: {checked: '#00FF00', unchecked: '#FF0000, disabled: '#CCCCCC'}
Could you check it out?
Thanks

euvl commented

Hey @mikeda37 , What do you mean by not working? Did you get any error message or smth?

I didn't get any errors.
color="{checked: '#00FF00', unchecked: '#FF0000, disabled: '#CCCCCC'}" does just not work while color="#00FF00" works.

euvl commented

to bind variables in vue js you have to either use v-bind:color="{}" or :color="{}"

I realized a single quote around the color code is missing with your Example and I just copied it.
Now I confirmed it works with colon.
However, I wonder why switchColor="{checked: '#00FF00', unchecked: '#FF0000', disabled: '#CCCCCC'}" works without colon.
Thanks anyway.

euvl commented

You are welcome 😉