Skip to content

Commit c642fa2

Browse files
author
Guillaume Chau
committed
fix: better peformance and scroll stability
1 parent 1d2b6ff commit c642fa2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/components/DynamicScroller.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ export default {
103103
},
104104
105105
watch: {
106-
items: 'forceUpdate',
106+
items () {
107+
this.forceUpdate(false)
108+
},
107109
},
108110
109111
created () {
@@ -138,8 +140,8 @@ export default {
138140
this.$emit('visible')
139141
},
140142
141-
forceUpdate () {
142-
this.vscrollData.heights = {}
143+
forceUpdate (clear = true) {
144+
if (clear) this.vscrollData.heights = {}
143145
this.$emit('vscroll:update', { force: true })
144146
},
145147

0 commit comments

Comments
 (0)