实现如图效果
在rowSelection中配置renderCell
const rowSelection = {
onChange: (selectedRowKeys, selectedRows) => {
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
},
getCheckboxProps: (record) => ({
disabled: record.name === 'Disabled User',
// Column configuration not to be checked
name: record.name,
}),
renderCell: (checked, record, index, originNode) => {
if (record.name === 'Jim Green') {
return null;
}
return originNode;
},
};