File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change 7
7
>
8
8
<div
9
9
class =" item-wrapper"
10
- :style =" ' height:' + totalHeight + 'px'"
10
+ :style =" { height: totalHeight + 'px' } "
11
11
>
12
12
<div
13
13
v-for =" view of pool"
14
14
:key =" view.nr.id"
15
15
class =" item-view"
16
- :style =" ' transform:translateY(' + view.top + 'px)'"
16
+ :style =" { transform: ' translateY(' + view.top + 'px)' } "
17
17
>
18
18
<slot
19
19
:item =" view.item"
@@ -238,8 +238,8 @@ export default {
238
238
239
239
if (this .$_continuous !== continuous) {
240
240
if (continuous) {
241
- this . $_views .clear ()
242
- this . $_unusedViews .clear ()
241
+ views .clear ()
242
+ unusedViews .clear ()
243
243
for (let i = 0 , l = pool .length ; i < l; i++ ) {
244
244
view = pool[i]
245
245
this .unuseView (view)
@@ -249,12 +249,18 @@ export default {
249
249
} else if (continuous) {
250
250
for (let i = 0 , l = pool .length ; i < l; i++ ) {
251
251
view = pool[i]
252
- if (view .nr .used && (
253
- view .nr .index < startIndex ||
254
- view .nr .index > endIndex ||
255
- (checkItem && ! items .includes (view .item ))
256
- )) {
257
- this .unuseView (view)
252
+ if (view .nr .used ) {
253
+ // Update view item index
254
+ if (checkItem) view .nr .index = items .indexOf (view .item )
255
+
256
+ // Check if index is still in visible range
257
+ if (
258
+ view .nr .index === - 1 ||
259
+ view .nr .index < startIndex ||
260
+ view .nr .index > endIndex
261
+ ) {
262
+ this .unuseView (view)
263
+ }
258
264
}
259
265
}
260
266
}
You can’t perform that action at this time.
0 commit comments