ant table中通过赋值取消选中值

vue中table

<a-table ref="table"
       size="middle"
       bordered
       rowKey="id"
       :columns="columns"
       :dataSource="dataSources"
       :pagination="ipagination"
       :loading="loading"
       :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, fixed: true}"
       @change="handleTableChange">
</a-table>

js部分

methods: {
    transfer(values){
      console.log("清除选中")
      //values为空数组
      this.selectedRowKeys=values;
    },
}

将selectedRowKeys重新赋值即可改变选中状态

原文地址:https://www.cnblogs.com/eternityz/p/12271904.html