antd Table表格 单选按钮

效果图:

引入antd的表格后:
<Table bordered columns={columns} dataSource={dataSource} rowSelection={rowRadioSelection} pagination={false}rowKey={dataSource => dataSource.openid}/>

单选与多选使用的是rowSelection,rowSelection默认是为多选,

const rowRadioSelection={

type:'radio',

columnTitle:"选择",

onSelect: (selectedRowKeys, selectedRows) => {

console.log(selectedRowKeys, selectedRows)

},

},

猜你喜欢

转载自blog.csdn.net/Zeng__Yi/article/details/83177331