给a-table添加:customRow="rowClick"
<a-table
bordered
ref="table"
size="middle"
:columns="columns"
:dataSource="dataSource"
:loading="loading"
@change="handleTableChange"
:customRow="rowClick"
:scroll="{ x: 'calc(700px + 50%)', y: 500 }"
>
在methods配置项中添加
rowClick: (item, index) => ({
on: {
click: () => {
console.log(item, index)
},
},
}),