Skip to content

Table添加rowClick事件 #1366

Closed
Closed
@cz-framework

Description

@cz-framework
  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

当用户点击整行的时候,可以触发一些东西(例如弹出详情的窗口)

What does the proposed API look like?

事件为:rowClick。
参数为:row(当前行的数据), index(当前行的序号)

<template>
  <a-table
    :columns="columns"
    :dataSource="data"
    @rowClick="handleRowClick"
  >
    ……
  </a-table>
</template>
<script>
export default {
  ……
  methods: {
    handleRowClick (row, index) {
      console.info('当前点击行的数据', row)
      console.info('当前点击行的序号', index)
    }
  }
  ……
}
</script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions