【已解决】React Ant Design中table里面使用onclick事件页面加载后自动执行,点击无效

问 题 : Ant Design中table里面使用onclick事件页面加载后自动执行,然后点击无效

解决方案:

{
                title: '操作',
                dataIndex: 'id',
                key: 'id',
                width: "7%",
                render: (text,record) =>
                 <a href="javascript:;" onClick={this.Test.bind(this, text)}>查看</a>,   //在此添加bind即可

            }

Test=()=>{

}

猜你喜欢

转载自blog.csdn.net/qq_29819449/article/details/79985877