minhur / bootstrap-toggle

Bootstrap Toggle is a highly flexible Bootstrap plugin that converts checkboxes into toggles
http://www.bootstraptoggle.com
MIT License
1.48k stars 440 forks source link

VueJS 2 v-model not working #196

Open marcioelias opened 6 years ago

marcioelias commented 6 years ago

Hello, anyone using this component with VueJS 2?

I'm trying to use with v-model to change a data value and is not working. If I use a default checkbox all works.

<input type="checkbox" v-model="itemCheck" name="item-check" data-toggle="toggle" data-width="55" data-size="mini" data-onstyle="success" data-offstyle="default" />

MOSapeizer commented 6 years ago

I tried a workaround with change event

<input type="checkbox" onchange="vm.itemCheck = $(this).prop('checked')" .../>

easydeveloppement commented 5 years ago

the workaround works fine for me ! thanks!