antd-vue中给table表格整行加点击事件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<a-table
:columns="columns"
:dataSource="data"
:loading="loading"
:pagination="pagination"
:rowKey="record => record.id"
@change="paginationChange"
bordered
:customRow="click" // 这个是重点,主要是给table添加属性的作用
>

// 内容

</a-table>
1
2
3
4
5
6
7
8
9
10
11
methods: {
click(record, index){
return {
on: {
click: () => {
console.log(record,index)
}
}
}
}
}
#

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×