Vue + element 实现列表复选框并保存已选id集合1.引用element组件多选框组,checkList为提交后台数据得数组,tableData为数据源
2.初始化tableData集合
3.循环遍历需要显示得值
4.在多选框组上添加chang事件
tableData: [{

date: '2021-05-02',

name: '王小虎',

address: '上海市普陀区金沙江路 1518 弄'

}, {

date: '2021-05-04',

name: '王小虎',

address: '上海市普陀区金沙江路 1517 弄'

}, {

date: '2021-05-01',

name: '王小虎',

address: '上海市普陀区金沙江路 1519 弄'

}, {

date: '2021-05-03',

name: '王小虎',

address: '上海市普陀区金沙江路 1516 弄'

}]
tableData: [{

date: '2021-05-02',

name: '王小虎',

address: '上海市普陀区金沙江路 1518 弄'

}, {

date: '2021-05-04',

name: '王小虎',

address: '上海市普陀区金沙江路 1517 弄'

}, {

date: '2021-05-01',

name: '王小虎',

address: '上海市普陀区金沙江路 1519 弄'

}, {

date: '2021-05-03',

name: '王小虎',

address: '上海市普陀区金沙江路 1516 弄'

}]




{{c.date}}








{{c.date}}




ch(){

console.log(this.checkList)
},
ch(){

console.log(this.checkList)
},需要反显得话 只要后台将与:label对应得字段用数组返回即可总结总结总结