antd table怎么实现点击详情按钮弹出详情内容,不是点击一行

antd table怎么实现点击详情按钮弹出详情内容,不是点击一行
`const columns: ColumnProps<any>[] = [

{ title: 'Id', width: 100, dataIndex: 'key', key: 'key', fixed: 'left' },
{ title: 'Full Name', dataIndex: 'name', key: 'name' },
{ title: 'Age', dataIndex: 'age', key: 'age' },
{
    title: 'Action',
    key: 'operation',
    fixed: 'right',
    width: 100,
    render: (text: any, record: any) => (
        <Button>Action 一 {record.key}</Button>
    ),
},

];`

react新手,尝试各种button按钮添加点击事件,总有报错,正确写法请大神指教### 问题描述

阅读 4.2k
1 个回答

其实和你的差不多,就给button一个点击事件

{
    title: 'Action',
    key: 'operation',
    fixed: 'right',
    width: 100,
    render: (text: any, record: any) => (
        <Button onClick={() => this.onOpenDetailsDialog(record.id)}>详情</Button>
    ),
},
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题