Skip to content

Commit cf6315b

Browse files
committed
fix: v is undefined
1 parent 5e39654 commit cf6315b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/components/RecycleScroller.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -441,16 +441,17 @@ export default {
441441
view = this.addView(pool, i, item, key, type)
442442
}
443443
} else {
444+
// Use existing view
445+
// We don't care if they are already used
446+
// because we are not in continous scrolling
447+
v = unusedIndex.get(type) || 0
448+
444449
if (!unusedPool || v >= unusedPool.length) {
445450
view = this.addView(pool, i, item, key, type)
446451
this.unuseView(view, true)
452+
unusedPool = unusedViews.get(type)
447453
}
448-
unusedPool = unusedViews.get(type)
449454
450-
// Use existing view
451-
// We don't care if they are already used
452-
// because we are not in continous scrolling
453-
v = unusedIndex.get(type) || 0
454455
view = unusedPool[v]
455456
view.item = item
456457
view.nr.used = true

0 commit comments

Comments
 (0)