需求:鼠标滑过表单行时,出现小手,点击时,可以跳转至编辑页 文档地址:https://antdv.com/components/table-cn/ 实践操作:
<template>
<a-table
:loading="loading"
:columns="columns"
:data-source="dataSource.list"
rowKey="Id"
:pagination="paginationSet"
:locale="locale"
v-if="!cardloading"
:customRow="click" // 关键点
>
<!-- 业务内容 -->
</a-table>
</template>
<script>
export default {
methods: {
toEdit (Id) {
this.$router.push({ path: '/route/EditRoute', query: { pId: Id } })
},
click (record, index) {
return {
style: {
'cursor': 'pointer'
},
on: {
click: () => {
console.log(record, index)
this.toEdit(record.Id)
}
}
}
}
}
}
</script>