feat(components): [table] expose scroll event (#12524)

* feat(components): [table] expose scroll event

* chore: update doc
This commit is contained in:
blesstosam 2024-11-20 21:49:22 +08:00 committed by GitHub
parent 897ba8bb9d
commit f1e95dc3a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -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

View File

@ -65,6 +65,7 @@
:wrap-style="scrollbarStyle"
:always="scrollbarAlwaysOn"
:tabindex="scrollbarTabindex"
@scroll="$emit('scroll', $event)"
>
<table
ref="tableBody"
@ -229,6 +230,7 @@ export default defineComponent({
'current-change',
'header-dragend',
'expand-change',
'scroll',
],
setup(props) {
type Row = typeof props.data[number]