constructor (){
this.state = {
expandedRowKeys: []
}
}
render () {
const {selectedRowKeys} = this.state
const rowSelection = (index) =>{
return {
selectedRowKeys: selectedRowKeys[index],
onChange: (selectedKeys, selectedRows ) => {
// 此处进行其他操作
console.log(selectedKeys, selectedRows)
}
}
}
return(
<Col>{
this.state.tableData.map((Item,index) =>{
<Table columns=this.columns
dataSource={item.tableData}
rowKey={(record) => record.id}
rowSelection={rowSelection(index)}/
expandedRowKeys={selectedRowKeys}>
})
}</Col>
)
}
antd的多个table渲染带复选框
最新推荐文章于 2024-07-30 11:21:13 发布