new Vue({
el: '...',
data: {
checkeditems: []
}
})

<div v-for="item in instituteModel" v-if="instituteModel.length > 0">
<input type="checkbox" id="item.id" value="item.inst_name" v-model="checkeditems"/>
</div>
&#13;
中点击复选框
答案 0 :(得分:0)
它不起作用,因为你必须绑定id
和value
。这应该起作用:
<div v-for="item in instituteModel" v-if="instituteModel.length > 0">
<input type="checkbox" :id="item.id" :value="item.inst_name" v-model="checkeditems"/>
</div>