From f1e95dc3a98ca62701f0cba5d4701ec0fba4dc8f Mon Sep 17 00:00:00 2001 From: blesstosam <805902285@qq.com> Date: Wed, 20 Nov 2024 21:49:22 +0800 Subject: [PATCH] feat(components): [table] expose scroll event (#12524) * feat(components): [table] expose scroll event * chore: update doc --- docs/en-US/component/table.md | 1 + packages/components/table/src/table.vue | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docs/en-US/component/table.md b/docs/en-US/component/table.md index 705205e89f..a26e96ebda 100644 --- a/docs/en-US/component/table.md +++ b/docs/en-US/component/table.md @@ -312,6 +312,7 @@ table/table-layout | current-change | triggers when current row changes | ^[Function]`(currentRow: any, oldCurrentRow: any) => void` | | header-dragend | triggers after changing a column's width by dragging the column header's border | ^[Function]`(newWidth: number, oldWidth: number, column: any, event: MouseEvent) => void` | | expand-change | triggers when user expands or collapses a row (for expandable table, second param is expandedRows; for tree Table, second param is expanded) | ^[Function]`(row: any, expandedRows: any[]) => void & (row: any, expanded: boolean) => void` | +| scroll ^(2.9.0) | Invoked after scrolled | ^[Function]`({ scrollLeft: number, scrollTop: number }) => void` | ### Table Slots diff --git a/packages/components/table/src/table.vue b/packages/components/table/src/table.vue index 60a9a18b68..c376d9d984 100644 --- a/packages/components/table/src/table.vue +++ b/packages/components/table/src/table.vue @@ -65,6 +65,7 @@ :wrap-style="scrollbarStyle" :always="scrollbarAlwaysOn" :tabindex="scrollbarTabindex" + @scroll="$emit('scroll', $event)" >