给Table组件添加Click事件,实现点击某行数据操作

通过customRow 属性给table添加自定义事件

<a-table
      :columns="columns"
      :dataSource="data"
      :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange ,onSelect: handleSelect}"
      bordered
      :customRow="handleClickRow"
    >
    </a-table>
methods: {
    handleClickRow(record, index){
        return {
            on: {
               click: () => {
                    console.log(record, index)
            				console.log('点击行内容record' + record)
            				console.log('序号索引index' + index)
               }
            }
        }
    }
}

控制台输出:
Antd-vue Table组件添加Click事件,实现点击某行数据操作_click事件