feat(components): [table] support native scrollbar (#21539)

* feat(components): [table] support native scrollbar

* Update table.vue

* Update packages/components/table/src/table/defaults.ts

Co-authored-by: btea <2356281422@qq.com>

---------

Co-authored-by: anhao <wzanh@sinopec.com>
Co-authored-by: btea <2356281422@qq.com>
This commit is contained in:
An Hao
2025-07-30 11:11:42 +08:00
committed by GitHub
parent 9a7c0b6d97
commit 9bd2f8a4f5
3 changed files with 7 additions and 0 deletions

View File

@@ -304,6 +304,7 @@ table/tooltip-formatter
| allow-drag-last-column ^(2.9.2) | whether to allow drag the last column | ^[boolean] | true |
| tooltip-formatter ^(2.9.4) | customize tooltip content when using `show-overflow-tooltip` | ^[Function]`(data: { row: any, column: any, cellValue: any }) => VNode \| string` | — |
| preserve-expanded-content ^(2.9.7) | whether to preserve expanded row content in DOM when collapsed | ^[boolean] | false |
| native-scrollbar ^(2.10.5) | whether to use native scrollbars | ^[boolean] | false |
### Table Events

View File

@@ -66,6 +66,7 @@
:wrap-style="scrollbarStyle"
:always="scrollbarAlwaysOn"
:tabindex="scrollbarTabindex"
:native="nativeScrollbar"
@scroll="$emit('scroll', $event)"
>
<table

View File

@@ -160,6 +160,7 @@ interface TableProps<T extends DefaultRow> {
tooltipFormatter?: TableOverflowTooltipFormatter<T>
appendFilterPanelTo?: string
scrollbarTabindex?: number | string
nativeScrollbar?: boolean
}
type TableTooltipData<T extends DefaultRow> = Parameters<
@@ -421,6 +422,10 @@ export default {
* @description whether to preserve expanded row content in DOM when collapsed
*/
preserveExpandedContent: Boolean,
/**
* @description whether to use native scrollbars
*/
nativeScrollbar: Boolean,
}
export type {
SummaryMethod,