需要将 2 个按钮连接到一列中
我想在如下图所示的列中显示 2 个按钮
column = [
{
title: 'operation',
dataIndex: 'operation',
render: (_, record) =>
const editable = isEditing(record);
return editable ? (
<span>
<a onClick={cancel} >Cancel</a>
</span>
) : (
<Typography.Link onClick={() => edit(record)}>
Edit
</Typography.Link>
);
state.dataSource.length >= 1 ? (
<Popconfirm title="Sure want to remove?" onConfirm={() => handleDelete(record.key)}>
<a>Remove</a>
</Popconfirm>
) : null,
},]
我尝试这样做..但是代码本身出错..如何显示2个按钮?我正在使用 ant 表
I want to display 2 button in a column like below shown pic
column = [
{
title: 'operation',
dataIndex: 'operation',
render: (_, record) =>
const editable = isEditing(record);
return editable ? (
<span>
<a onClick={cancel} >Cancel</a>
</span>
) : (
<Typography.Link onClick={() => edit(record)}>
Edit
</Typography.Link>
);
state.dataSource.length >= 1 ? (
<Popconfirm title="Sure want to remove?" onConfirm={() => handleDelete(record.key)}>
<a>Remove</a>
</Popconfirm>
) : null,
},]
I'm tried to do it.. But error in code itself.. How to show 2 buttons? Iam using ant Table
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
基本上,您在列对象的“渲染”属性中返回的内容将在表的列中渲染。
basically what you return inside the 'render' property of the column object will render in the table's column.