@@ -258,6 +258,10 @@ var VirtualScroller = { render: function render() {
258258 emitUpdate : {
259259 type : Boolean ,
260260 default : false
261+ } ,
262+ delayPreviousItems : {
263+ type : Boolean ,
264+ default : false
261265 }
262266 } ,
263267
@@ -421,18 +425,23 @@ var VirtualScroller = { render: function render() {
421425 if ( this . _startIndex !== startIndex || this . _endIndex !== endIndex || this . _offsetTop !== offsetTop || this . _height !== containerHeight || this . _length !== l ) {
422426 this . keysEnabled = ! ( startIndex > this . _endIndex || endIndex < this . _startIndex ) ;
423427
424- // Add next items
425- this . visibleItems = items . slice ( this . _startIndex , endIndex ) ;
426428 this . itemContainerStyle = {
427429 height : containerHeight + 'px'
428430 } ;
429431 this . itemsStyle = {
430432 marginTop : offsetTop + 'px'
433+ } ;
431434
435+ if ( this . delayPreviousItems ) {
436+ // Add next items
437+ this . visibleItems = items . slice ( this . _startIndex , endIndex ) ;
432438 // 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+ }
436445
437446 this . emitUpdate && this . $emit ( 'update' , startIndex , endIndex ) ;
438447
@@ -483,6 +492,7 @@ var VirtualScroller = { render: function render() {
483492 var _this2 = this ;
484493
485494 if ( this . _ready && ( isVisible || entry . boundingClientRect . width !== 0 || entry . boundingClientRect . height !== 0 ) ) {
495+ this . $emit ( 'visible' ) ;
486496 this . $nextTick ( function ( ) {
487497 _this2 . updateVisibleItems ( ) ;
488498 } ) ;
@@ -530,7 +540,7 @@ function registerComponents(Vue, prefix) {
530540
531541var plugin = {
532542 // eslint-disable-next-line no-undef
533- version : "0.10.2 " ,
543+ version : "0.10.4 " ,
534544 install : function install ( Vue , options ) {
535545 var finalOptions = Object . assign ( { } , {
536546 installComponents : true ,
0 commit comments