elementui table checkBox 多选表格 从列表进详情,看到该条信息之前选择的几项数据
info() {
// 这个是获取详情数据的接口
var a;
this.get("/business/label/" + this.id).then((res) => {
console.log(res);
if (res.code == 200) {
// 上图右边的数据列表
this.SelectedPersonnel = res.data.membersList;
// 循环 用两边数据都有的key值 取到左边那列 对应的那条数据
for (let i = 0; i < this.SelectedPersonnel.length; i++) {
for (let j = 0; j < this.tableData.length; j++) {
if (
this.SelectedPersonnel[i].userId == this.tableData[j].userId
) {
a = this.tableData[j];
// 最重要的就是这个,在elementui 官网有这个方法,让这行的状态为true 选中