动态加载的el-checkbox-group绑定model的问题

借鉴:https://www.cnblogs.com/w2xh/p/8260752.html

 <li v-for="(item,index) in exerciseList"
 :key="index">
 	<el-checkbox-group v-model="chooseBox[index]" @change="radioChange(item)">
	    <el-checkbox  v-for="itemRadio in item.content"
	    :key="itemRadio.radios"
	    :label="itemRadio.radios">
	    {{itemRadio.radiosContent}}
	    </el-checkbox>
	</el-checkbox-group>
</li>

如代码,会循环出来多个checkbox,这时候绑定的v-model就有问题。
创建一个对象,动态的给里面添加数组
在这里插入图片描述
在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章