I am encountering this strange behavior in my code in Vue 2
What I am trying to achieve here is when I clicked on one of the checkbox, other checkbox(es) are checked as well. I only want the selected checkbox to be checked only. Is there a way to do so?
this is my component
<div v-for="(item,index) in api[0].choice" :key="index">
<input type="checkbox" @change="detect" v-model="option[index].checked">
<label>{{item}}</label>
</div>
data(){}
option: null,
mounted(){}
this.option = Array(this.api[0].choice.length).fill({checked: false})