From d3c7202d179f918f1436eb074b109a8ef8dccd8f Mon Sep 17 00:00:00 2001 From: Yi Feng <66539215+bigyifeng@users.noreply.github.com> Date: Tue, 5 Dec 2023 10:41:35 +0800 Subject: [PATCH] chore: Get rid of redundant code --- .../vue-virtual-scroller/src/components/RecycleScroller.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/vue-virtual-scroller/src/components/RecycleScroller.vue b/packages/vue-virtual-scroller/src/components/RecycleScroller.vue index 26246554..bc0fc439 100644 --- a/packages/vue-virtual-scroller/src/components/RecycleScroller.vue +++ b/packages/vue-virtual-scroller/src/components/RecycleScroller.vue @@ -378,7 +378,8 @@ export default { handleScroll (event) { if (!this.$_scrollDirty) { this.$_scrollDirty = true - this.$emit('scroll-start', this.getScroll()); + const scroll = this.getScroll() + this.$emit('scroll-start',scroll); if (this.$_updateTimeout) return const requestUpdate = () => requestAnimationFrame(() => { @@ -390,7 +391,7 @@ export default { if (!continuous) { clearTimeout(this.$_refreshTimeout) this.$_refreshTimeout = setTimeout(this.handleScroll, this.updateInterval + 100) - this.$emit('scroll-end', this.getScroll()); + this.$emit('scroll-end', scroll); } })