Ant Design ProTable 隐藏自带 Checkbox
要隐藏 ProTable 组件自带的 checkbox,可以通过设置 'rowSelection' 属性为 'false' 来实现。
示例代码如下:
import ProTable from '@ant-design/pro-table';
const columns = [
{
title: '姓名',
dataIndex: 'name',
},
{
title: '年龄',
dataIndex: 'age',
},
// 其他列...
];
const data = [
{
key: '1',
name: '张三',
age: 18,
},
{
key: '2',
name: '李四',
age: 20,
},
// 其他数据...
];
const Demo = () => {
return (
<ProTable
columns={columns}
dataSource={data}
rowSelection={false}
/>
);
};
export default Demo;
在上面的示例代码中,通过将 'rowSelection' 属性设置为 'false',即可隐藏 ProTable 组件自带的 checkbox。
原文地址: https://www.cveoy.top/t/topic/pkU7 著作权归作者所有。请勿转载和采集!