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 选中
this.$refs.multipleTable &&
this.$ref

本文介绍如何在ElementUI的Table组件中使用CheckBox实现多选表格,并在从列表进入详情时回显之前选择的内容。文章指出解决这个问题并不涉及row-key属性,而是深入探讨了ElementUI的一些潜在陷阱。
最低0.47元/天 解锁文章
2770

被折叠的 条评论
为什么被折叠?



