From 9bd2f8a4f5bef90a31bcf49978d779fa6dff7bf4 Mon Sep 17 00:00:00 2001 From: An Hao <46664126+btnkr@users.noreply.github.com> Date: Wed, 30 Jul 2025 11:11:42 +0800 Subject: [PATCH] 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 Co-authored-by: btea <2356281422@qq.com> --- docs/en-US/component/table.md | 1 + packages/components/table/src/table.vue | 1 + packages/components/table/src/table/defaults.ts | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/docs/en-US/component/table.md b/docs/en-US/component/table.md index 839d733ab6..86a7738e50 100644 --- a/docs/en-US/component/table.md +++ b/docs/en-US/component/table.md @@ -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 diff --git a/packages/components/table/src/table.vue b/packages/components/table/src/table.vue index e414b8ead3..f43ccfd4f9 100644 --- a/packages/components/table/src/table.vue +++ b/packages/components/table/src/table.vue @@ -66,6 +66,7 @@ :wrap-style="scrollbarStyle" :always="scrollbarAlwaysOn" :tabindex="scrollbarTabindex" + :native="nativeScrollbar" @scroll="$emit('scroll', $event)" > { tooltipFormatter?: TableOverflowTooltipFormatter appendFilterPanelTo?: string scrollbarTabindex?: number | string + nativeScrollbar?: boolean } type TableTooltipData = 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,