mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-27 02:01:15 +08:00
feat(components): [table] expose scroll event (#12524)
* feat(components): [table] expose scroll event * chore: update doc
This commit is contained in:
parent
897ba8bb9d
commit
f1e95dc3a9
@ -312,6 +312,7 @@ table/table-layout
|
|||||||
| current-change | triggers when current row changes | ^[Function]`(currentRow: any, oldCurrentRow: any) => void` |
|
| 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` |
|
| 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` |
|
| 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
|
### Table Slots
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@
|
|||||||
:wrap-style="scrollbarStyle"
|
:wrap-style="scrollbarStyle"
|
||||||
:always="scrollbarAlwaysOn"
|
:always="scrollbarAlwaysOn"
|
||||||
:tabindex="scrollbarTabindex"
|
:tabindex="scrollbarTabindex"
|
||||||
|
@scroll="$emit('scroll', $event)"
|
||||||
>
|
>
|
||||||
<table
|
<table
|
||||||
ref="tableBody"
|
ref="tableBody"
|
||||||
@ -229,6 +230,7 @@ export default defineComponent({
|
|||||||
'current-change',
|
'current-change',
|
||||||
'header-dragend',
|
'header-dragend',
|
||||||
'expand-change',
|
'expand-change',
|
||||||
|
'scroll',
|
||||||
],
|
],
|
||||||
setup(props) {
|
setup(props) {
|
||||||
type Row = typeof props.data[number]
|
type Row = typeof props.data[number]
|
||||||
|
Loading…
Reference in New Issue
Block a user