I'm using a JS plugin for Checkbox.
This plugin creates a switch button that mimics the state of the checkbox.
When the switch button is toggled its change the checked
value of the checkbox.
<input type="checkbox" v-model="active" class="switch">
<script>
var app = new Vue({
el: '#app',
data: {
active: false
}
})
</script>
However the active
data value is only updated when the user clicks on the checkbox. Changing the checkbox checked
attribute programmatically does not trigger the vue.
How can I update the vue data
when the input is changed programmatically? for instance $("#myinput").prop("checked",true)