arr1: [
{
id: 1,
right: true,
rightName: "对的",
wrong: false,
wrongName: "错的"
},
{
id: 2,
right: true,
rightName: "对的",
wrong: false,
wrongName: "错的"
},
{
id: 3,
right: true,
rightName: "对的",
wrong: false,
wrongName: "错的"
}
],
arr2: []
<li v-for="item in arr1" :key="item.id" @click="addToArr2(item)">
<div>
<input type="checkbox" v-model="item.right">
<span>{{item.rightName}}</span>
<input type="checkbox" v-model="item.wrong">
<span>{{item.wrongName}}</span>
</div>
<hr>
</li>
addToArr2(item){
this.arr2.push(item)
}
添加回答
举报
0/150
提交
取消