Skip to content

Commit 51c7e18

Browse files
committed
功能优化
1 parent 24e0dcf commit 51c7e18

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

packages/ve-table/src/index.jsx

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1791,26 +1791,30 @@ export default {
17911791
style: tableContainerStyle,
17921792
on: {
17931793
scroll: () => {
1794-
this.tableContainerScrollHandler();
1794+
if (isVirtualScroll) {
1795+
this.tableContainerScrollHandler();
17951796

1796-
const {
1797-
virtualScrollStartIndex: startIndex,
1798-
previewVirtualScrollStartIndex: previewStartIndex,
1799-
} = this.$options.customOption;
1797+
const {
1798+
virtualScrollStartIndex: startIndex,
1799+
previewVirtualScrollStartIndex: previewStartIndex,
1800+
} = this.$options.customOption;
18001801

1801-
const differ = Math.abs(startIndex - previewStartIndex);
1802+
const differ = Math.abs(startIndex - previewStartIndex);
18021803

1803-
this.$options.customOption.previewVirtualScrollStartIndex =
1804-
startIndex;
1804+
this.$options.customOption.previewVirtualScrollStartIndex =
1805+
startIndex;
18051806

1806-
// default placeholder per scrolling row count
1807-
if (differ > this.defaultPlaceholderPerScrollingRowCount) {
1808-
this.isScrolling = true;
1809-
} else {
1810-
this.isScrolling = false;
1811-
}
1807+
// default placeholder per scrolling row count
1808+
if (
1809+
differ > this.defaultPlaceholderPerScrollingRowCount
1810+
) {
1811+
this.isScrolling = true;
1812+
} else {
1813+
this.isScrolling = false;
1814+
}
18121815

1813-
this.debounceScrollEnded();
1816+
this.debounceScrollEnded();
1817+
}
18141818
},
18151819
},
18161820
directives: [

0 commit comments

Comments
 (0)