euvl/vue-js-toggle-button

Request: value binding

Closed this issue · 5 comments

In toggle options, set sync to true.

euvl commented

Hi @akhchan99, as @tylerjheslop rightly said, just use sync=true. Take a look in demo for examples and to readme for more info.

What I want is the binding to a value other than boolean true/false, in the Vue inbox example, they have options to add these v-bind:true-value="a" v-bind:false-value="b"

euvl commented

Can't see reason to do it, why simply not to do: v-bind:value=" v === 'a' "?

Reason being setting the v-model will end up being a boolean again, not 'a' or 'b', and will need a @change event to update the model to the desired value.

Just trying to reduce the extra methods, and use v-model instead of binding the value directly