@@ -64,24 +64,16 @@ export default {
64
64
},
65
65
66
66
watch: {
67
- items: {
68
- handler () {
69
- this .updateVisibleItems ({
70
- checkItem: true ,
71
- })
67
+ items () {
68
+ this .updateVisibleItems (true )
72
69
},
73
- },
74
70
pageMode () {
75
71
this .applyPageMode ()
76
- this .updateVisibleItems ({
77
- checkItem: false ,
78
- })
72
+ this .updateVisibleItems (false )
79
73
},
80
74
heights: {
81
75
handler () {
82
- this .updateVisibleItems ({
83
- checkItem: false ,
84
- })
76
+ this .updateVisibleItems (false )
85
77
},
86
78
deep: true ,
87
79
},
@@ -101,9 +93,7 @@ export default {
101
93
mounted () {
102
94
this .applyPageMode ()
103
95
this .$nextTick (() => {
104
- this .updateVisibleItems ({
105
- checkItem: true ,
106
- })
96
+ this .updateVisibleItems (true )
107
97
this .$_ready = true
108
98
})
109
99
},
@@ -147,19 +137,15 @@ export default {
147
137
148
138
handleResize () {
149
139
this .$emit (' resize' )
150
- this .$_ready && this .updateVisibleItems ({
151
- checkItem: false ,
152
- })
140
+ if (this .$_ready ) this .updateVisibleItems (false )
153
141
},
154
142
155
143
handleScroll (event ) {
156
144
if (! this .$_scrollDirty ) {
157
145
this .$_scrollDirty = true
158
146
requestAnimationFrame (() => {
159
147
this .$_scrollDirty = false
160
- const { continuous } = this .updateVisibleItems ({
161
- checkItem: false ,
162
- })
148
+ const { continuous } = this .updateVisibleItems (false )
163
149
164
150
// It seems sometimes chrome doesn't fire scroll event :/
165
151
// When non continous scrolling is ending, we force a refresh
@@ -175,14 +161,12 @@ export default {
175
161
if (this .$_ready && (isVisible || entry .boundingClientRect .width !== 0 || entry .boundingClientRect .height !== 0 )) {
176
162
this .$emit (' visible' )
177
163
requestAnimationFrame (() => {
178
- this .updateVisibleItems ({
179
- checkItem: false ,
164
+ this .updateVisibleItems (false )
180
165
})
181
- })
182
166
}
183
167
},
184
168
185
- updateVisibleItems ({ checkItem } ) {
169
+ updateVisibleItems (checkItem ) {
186
170
const scroll = this .getScroll ()
187
171
const buffer = parseInt (this .buffer )
188
172
scroll .top -= buffer
0 commit comments