Reputation: 24061
I have bound a checkbox (output from options data in a loop):
<input type="checkbox" v-model="option.active">
options: [
{
name: 'one',
active: false,
},
{
name: 'two',
active: false,
},
....
]
I also want a button to be able to turn off the checkbox.
How can I also bind a button to the model?
Upvotes: 0
Views: 55
Reputation: 111
You have to use the click event of the button:
<button v-on:click="option.active = false">Click</button>
or
<button @click="option.active = false">Click</button>
Upvotes: 1