在vue2中 vue ant design a-table每一行添加点击事件 在a-table中添加 :customRow="rowClick"
<!-- 在 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) {
return {
on: {
click: () => {
this.edit(null, item, null)
},
mouseenter: () => {
// cursor: pointer;
// item.style.cursor = 'hand'
}
},
}
},

浙公网安备 33010602011771号