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

Posted eternityz

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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重新赋值即可改变选中状态

以上是关于ant table中通过赋值取消选中值的主要内容,如果未能解决你的问题,请参考以下文章