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>
    ),
},
推荐问题