Skip to content

Commit c3dc594

Browse files
authored
Merge pull request #544 from looeyf/feature/add-vertical-scrolling-class
feature: add header class on vertical scroll
2 parents 2215330 + 61c4d3d commit c3dc594

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/ve-table/src/index.jsx

+9
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,8 @@ export default {
360360
isLeftScrolling: false,
361361
// is scrolling right
362362
isRightScrolling: false,
363+
// is scrolling vertically
364+
isVerticalScrolling: false,
363365
// has horizontal scroll bar
364366
hasXScrollBar: false,
365367
// has vertical scroll bar
@@ -588,6 +590,7 @@ export default {
588590
isVirtualScroll,
589591
isLeftScrolling,
590592
isRightScrolling,
593+
isVerticalScrolling,
591594
isCellEditing,
592595
isAutofillStarting,
593596
enableCellSelection,
@@ -598,6 +601,7 @@ export default {
598601
[clsName("virtual-scroll")]: isVirtualScroll,
599602
[clsName("container-left-scrolling")]: isLeftScrolling,
600603
[clsName("container-right-scrolling")]: isRightScrolling,
604+
[clsName("container-vertical-scrolling")]: isVerticalScrolling,
601605
[clsName("is-cell-editing")]: isCellEditing,
602606
[clsName("autofilling")]: isAutofillStarting,
603607
// 如果开启单元格选择,则关闭 user-select
@@ -2071,6 +2075,11 @@ export default {
20712075
this.isLeftScrolling = scrollLeft > 0;
20722076
this.isRightScrolling = scrollWidth - clientWidth > scrollLeft;
20732077
}
2078+
2079+
if (this.fixedHeader) {
2080+
const { scrollTop } = tableContainerRef;
2081+
this.isVerticalScrolling = scrollTop > 0;
2082+
}
20742083
},
20752084

20762085
// set scroll bar status

0 commit comments

Comments
 (0)