@@ -258,6 +258,10 @@ var VirtualScroller = { render: function render() {
258
258
emitUpdate : {
259
259
type : Boolean ,
260
260
default : false
261
+ } ,
262
+ delayPreviousItems : {
263
+ type : Boolean ,
264
+ default : false
261
265
}
262
266
} ,
263
267
@@ -421,18 +425,23 @@ var VirtualScroller = { render: function render() {
421
425
if ( this . _startIndex !== startIndex || this . _endIndex !== endIndex || this . _offsetTop !== offsetTop || this . _height !== containerHeight || this . _length !== l ) {
422
426
this . keysEnabled = ! ( startIndex > this . _endIndex || endIndex < this . _startIndex ) ;
423
427
424
- // Add next items
425
- this . visibleItems = items . slice ( this . _startIndex , endIndex ) ;
426
428
this . itemContainerStyle = {
427
429
height : containerHeight + 'px'
428
430
} ;
429
431
this . itemsStyle = {
430
432
marginTop : offsetTop + 'px'
433
+ } ;
431
434
435
+ if ( this . delayPreviousItems ) {
436
+ // Add next items
437
+ this . visibleItems = items . slice ( this . _startIndex , endIndex ) ;
432
438
// Remove previous items
433
- } ; this . $nextTick ( function ( ) {
434
- _this . visibleItems = items . slice ( startIndex , endIndex ) ;
435
- } ) ;
439
+ this . $nextTick ( function ( ) {
440
+ _this . visibleItems = items . slice ( startIndex , endIndex ) ;
441
+ } ) ;
442
+ } else {
443
+ this . visibleItems = items . slice ( startIndex , endIndex ) ;
444
+ }
436
445
437
446
this . emitUpdate && this . $emit ( 'update' , startIndex , endIndex ) ;
438
447
@@ -483,6 +492,7 @@ var VirtualScroller = { render: function render() {
483
492
var _this2 = this ;
484
493
485
494
if ( this . _ready && ( isVisible || entry . boundingClientRect . width !== 0 || entry . boundingClientRect . height !== 0 ) ) {
495
+ this . $emit ( 'visible' ) ;
486
496
this . $nextTick ( function ( ) {
487
497
_this2 . updateVisibleItems ( ) ;
488
498
} ) ;
@@ -530,7 +540,7 @@ function registerComponents(Vue, prefix) {
530
540
531
541
var plugin = {
532
542
// eslint-disable-next-line no-undef
533
- version : "0.10.2 " ,
543
+ version : "0.10.4 " ,
534
544
install : function install ( Vue , options ) {
535
545
var finalOptions = Object . assign ( { } , {
536
546
installComponents : true ,
0 commit comments