vue antd a-table配置表格单选多选

<a-table

  ref="table"

  size="default"

  bordered

  rowKey="id"

  :columns="columns"

  :dataSource="dataSource"

  :pagination="ipagination"

  :loading="loading"

  :rowSelection="{selectedRowKeys:selectedRowKeys,onChange:onSelectChange,type:'radio'}"

//注释:配置参数 type类型  默认值为 Checkbox 多选  

            配置参数 type类型  默认值为 radio多选

  :scroll="{x: 3200}"

  :showHeder="true"

  @change="handleTableChange"></a-table>


js

onSelectChange(selectedRowKeys, selectionRows) {

 //selectedRowKeys为数组  , 相当于修改的哪一项 。  

//selectionRows为数组, 数组内为对应项的数据

this.selectedRowKeys = selectedRowKeys

this.selectionRows = selectionRows

},

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容