antd table点击行事件
antd table行点击事件
开发环境是vue
<a-table :columns="columns" row-key="Phone" :custom-Row="click" :data-source="tableData" >
</a-table>
<scritp>
methods: {
click: function (record, index) {
return {
on: { // 事件
click: function () {
console.log(record, index)
}
// 点击行
}
}
},
},
</script>
重点:row-key="Phone" :custom-Row="click" 不要看官方的api,切记加中间那个横线-;
