Skip to content

Commit 552d7a1

Browse files
committed
refactor: Use absolute scroll diff
1 parent 35c0ad2 commit 552d7a1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/RecycleScroller.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,13 +298,15 @@ export default {
298298
299299
// Skip update if use hasn't scrolled enough
300300
if (checkPositionDiff) {
301-
let positionDiff = scroll.originalStart - this.$_lastUpdateScrollPosition
302-
if (positionDiff < 0) positionDiff = -positionDiff
301+
const positionDiff = Math.abs(scroll.originalStart - this.$_lastUpdateScrollPosition)
303302
if ((itemSize === null && positionDiff < minItemSize) || positionDiff < itemSize) {
303+
console.log(`optimize`);
304+
304305
return {
305306
continuous: true,
306307
}
307308
}
309+
console.log(`render`);
308310
}
309311
}
310312

0 commit comments

Comments
 (0)