最近在开发过程中用到了vex table
根据需求需要根据接口参数默认勾选
在网上找到了相关方法
// 假设你已经有一个表格实例 table
const table = this.$refs.xTable;
// 设置第一行的复选框为选中状态
table.setCheckboxRow(table.getData()[0], true);
// 或者使用行的唯一标识(rowId)来设置
table.setCheckboxRow(‘rowId’, true);
//清空当页勾选
this.
r
e
f
s
.
r
e
f
t
a
b
l
e
t
a
s
k
.
c
l
e
a
r
C
h
e
c
k
b
o
x
R
o
w
(
)
;
/
/
清空其他页勾选
t
h
i
s
.
refs.ref_table_task.clearCheckboxRow(); //清空其他页勾选 this.
refs.reftabletask.clearCheckboxRow();//清空其他页勾选this.refs.ref_table_task.clearCheckboxReserve();
希望能够帮到你~
看到这如果对你有用就收藏加关注吧~
点个关注不迷路~~~~