@@ -598,7 +598,7 @@ var uid = 0;
598
598
var RecycleList = { render : function render ( ) {
599
599
var _vm = this ; var _h = _vm . $createElement ; var _c = _vm . _self . _c || _h ; return _c ( 'div' , { directives : [ { name : "observe-visibility" , rawName : "v-observe-visibility" , value : _vm . handleVisibilityChange , expression : "handleVisibilityChange" } ] , staticClass : "recycle-list" , class : _vm . cssClass , on : { "&scroll" : function scroll ( $event ) {
600
600
_vm . handleScroll ( $event ) ;
601
- } } } , [ _c ( 'div' , { staticClass : "item-wrapper" , style : { height : _vm . totalHeight + 'px' } } , _vm . _l ( _vm . pool , function ( view ) {
601
+ } } } , [ _c ( 'div' , { ref : "wrapper" , staticClass : "item-wrapper" , style : { height : _vm . totalHeight + 'px' } } , _vm . _l ( _vm . pool , function ( view ) {
602
602
return _c ( 'div' , { key : view . nr . id , staticClass : "item-view" , style : { transform : 'translateY(' + view . top + 'px)' } } , [ _vm . _t ( "default" , null , { item : view . item , active : view . nr . used } ) ] , 2 ) ;
603
603
} ) ) , _vm . _v ( " " ) , _vm . _t ( "after-container" ) , _vm . _v ( " " ) , _c ( 'resize-observer' , { on : { "notify" : _vm . handleResize } } ) ] , 2 ) ;
604
604
} , staticRenderFns : [ ] , _scopeId : 'data-v-2277f571' ,
@@ -767,50 +767,54 @@ var RecycleList = { render: function render() {
767
767
endIndex = void 0 ;
768
768
var totalHeight = void 0 ;
769
769
770
- // Variable height mode
771
- if ( itemHeight === null ) {
772
- var h = void 0 ;
773
- var a = 0 ;
774
- var b = count - 1 ;
775
- var i = ~ ~ ( count / 2 ) ;
776
- var oldI = void 0 ;
777
-
778
- // Searching for startIndex
779
- do {
780
- oldI = i ;
781
- h = heights [ i ] . accumulator ;
782
- if ( h < scroll . top ) {
783
- a = i ;
784
- } else if ( i < count - 1 && heights [ i + 1 ] . accumulator > scroll . top ) {
785
- b = i ;
770
+ if ( ! count ) {
771
+ startIndex = endIndex = totalHeight = 0 ;
772
+ } else {
773
+ // Variable height mode
774
+ if ( itemHeight === null ) {
775
+ var h = void 0 ;
776
+ var a = 0 ;
777
+ var b = count - 1 ;
778
+ var i = ~ ~ ( count / 2 ) ;
779
+ var oldI = void 0 ;
780
+
781
+ // Searching for startIndex
782
+ do {
783
+ oldI = i ;
784
+ h = heights [ i ] . accumulator ;
785
+ if ( h < scroll . top ) {
786
+ a = i ;
787
+ } else if ( i < count - 1 && heights [ i + 1 ] . accumulator > scroll . top ) {
788
+ b = i ;
789
+ }
790
+ i = ~ ~ ( ( a + b ) / 2 ) ;
791
+ } while ( i !== oldI ) ;
792
+ i < 0 && ( i = 0 ) ;
793
+ startIndex = i ;
794
+
795
+ // For container style
796
+ totalHeight = heights [ count - 1 ] . accumulator ;
797
+
798
+ // Searching for endIndex
799
+ for ( endIndex = i ; endIndex < count && heights [ endIndex ] . accumulator < scroll . bottom ; endIndex ++ ) { }
800
+ if ( endIndex === - 1 ) {
801
+ endIndex = items . length - 1 ;
802
+ } else {
803
+ endIndex ++ ;
804
+ // Bounds
805
+ endIndex > count && ( endIndex = count ) ;
786
806
}
787
- i = ~ ~ ( ( a + b ) / 2 ) ;
788
- } while ( i !== oldI ) ;
789
- i < 0 && ( i = 0 ) ;
790
- startIndex = i ;
791
-
792
- // For container style
793
- totalHeight = heights [ count - 1 ] . accumulator ;
794
-
795
- // Searching for endIndex
796
- for ( endIndex = i ; endIndex < count && heights [ endIndex ] . accumulator < scroll . bottom ; endIndex ++ ) { }
797
- if ( endIndex === - 1 ) {
798
- endIndex = items . length - 1 ;
799
807
} else {
800
- endIndex ++ ;
808
+ // Fixed height mode
809
+ startIndex = ~ ~ ( scroll . top / itemHeight ) ;
810
+ endIndex = Math . ceil ( scroll . bottom / itemHeight ) ;
811
+
801
812
// Bounds
813
+ startIndex < 0 && ( startIndex = 0 ) ;
802
814
endIndex > count && ( endIndex = count ) ;
803
- }
804
- } else {
805
- // Fixed height mode
806
- startIndex = ~ ~ ( scroll . top / itemHeight ) ;
807
- endIndex = Math . ceil ( scroll . bottom / itemHeight ) ;
808
815
809
- // Bounds
810
- startIndex < 0 && ( startIndex = 0 ) ;
811
- endIndex > count && ( endIndex = count ) ;
812
-
813
- totalHeight = count * itemHeight ;
816
+ totalHeight = count * itemHeight ;
817
+ }
814
818
}
815
819
816
820
this . totalHeight = totalHeight ;
@@ -927,7 +931,7 @@ function registerComponents(Vue, prefix) {
927
931
928
932
var plugin$4 = {
929
933
// eslint-disable-next-line no-undef
930
- version : "0.11.3 " ,
934
+ version : "0.11.4 " ,
931
935
install : function install ( Vue , options ) {
932
936
var finalOptions = Object . assign ( { } , {
933
937
installComponents : true ,
0 commit comments