File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 203
203
return ( cache && cache . size ) || this . variable ( index ) || 0
204
204
} ,
205
205
206
+ // return the variable paddingTop base current zone.
207
+ // @todo : if set a large `start` before variable was calculated,
208
+ // here will also case too much offset calculate when list is very large,
209
+ // consider use estimate paddingTop in this case just like `getVarPaddingBottom`.
210
+ getVarPaddingTop : function ( ) {
211
+ return this . getVarOffset ( this . delta . start )
212
+ } ,
213
+
206
214
// return the variable paddingBottom base current zone.
207
- getVarPaddingBottom ( ) {
215
+ getVarPaddingBottom : function ( ) {
208
216
var delta = this . delta
209
217
if ( delta . total - delta . end <= delta . keeps || delta . varLastCalcIndex === delta . total - 1 ) {
210
218
return this . getVarOffset ( delta . total ) - this . getVarOffset ( delta . end )
235
243
}
236
244
} ,
237
245
238
- // return the right zone info base on start/index.
246
+ // return the right zone info base on ` start/index` .
239
247
getZone ( index ) {
240
248
var start , end
241
249
var delta = this . delta
265
273
this . $refs . vsl . scrollTop = scrollTop
266
274
} ,
267
275
268
- // filter the shown items base on start and end.
276
+ // filter the shown items base on ` start` and ` end` .
269
277
filter : function ( ) {
270
278
var delta = this . delta
271
279
var slots = this . $slots . default
281
289
var hasPadding = slots . length > delta . keeps
282
290
283
291
if ( this . variable ) {
284
- paddingTop = hasPadding ? this . getVarOffset ( delta . start ) : 0
292
+ paddingTop = hasPadding ? this . getVarPaddingTop ( ) : 0
285
293
paddingBottom = hasPadding ? this . getVarPaddingBottom ( ) : 0
286
294
} else {
287
295
paddingTop = this . size * ( hasPadding ? delta . start : 0 )
You can’t perform that action at this time.
0 commit comments