@@ -45,7 +45,7 @@ Vue.component('virtual-list', {
4545
4646 // scroll to top
4747 if ( scrollTop === 0 ) {
48- this . $emit ( 'top ' ) ;
48+ this . $emit ( 'toTop ' ) ;
4949 }
5050
5151 // scroll to bottom
@@ -57,7 +57,7 @@ Vue.component('virtual-list', {
5757 if ( delta . direct === 'UP' && scrollTop < delta . padding_top ) {
5858 this . showPrev ( ) ;
5959 }
60- } , 16 , true , true ) ,
60+ } , 10 , true , true ) ,
6161
6262 saveDirect ( scrollTop ) {
6363 let delta = this . $options . delta ;
@@ -75,7 +75,7 @@ Vue.component('virtual-list', {
7575
7676 delta . page_type = 'NEXT' ;
7777 if ( delta . total - delta . start_index <= this . amount ) {
78- this . $emit ( 'bottom ' ) ;
78+ this . $emit ( 'toBottom ' ) ;
7979 } else {
8080 delta . start_index = delta . start_index + this . amount ;
8181 this . $forceUpdate ( ) ;
@@ -85,7 +85,7 @@ Vue.component('virtual-list', {
8585 showPrev ( ) {
8686 this . $options . delta . page_type = 'PREV' ;
8787 this . $forceUpdate ( ) ;
88- this . $emit ( 'prev ' ) ;
88+ this . $emit ( 'toPrev ' ) ;
8989 } ,
9090
9191 filter ( items ) {
@@ -114,9 +114,9 @@ Vue.component('virtual-list', {
114114 if ( nowStartIndex !== udf ) {
115115 delta . start_index = nowStartIndex ;
116116 }
117-
118- delta . padding_top = delta . start_index * this . unit ;
119117 }
118+
119+ delta . padding_top = delta . start_index * this . unit ;
120120 } else {
121121 // flipping next or first render
122122
@@ -143,11 +143,11 @@ Vue.component('virtual-list', {
143143
144144 // save virtual list new length
145145 delta . total = length ;
146- // all padding pixel, include top and bottom
147- // except remain and calculate when component update
148- delta . all_padding = ( length - this . remain ) * this . unit ;
149146 }
150147
148+ // all padding pixel, include top and bottom
149+ // except amount and calculate when component update
150+ delta . all_padding = ( length - this . amount ) * this . unit ;
151151 // padding-top piexl
152152 delta . padding_top = delta . start_index * this . unit ;
153153 }
@@ -177,8 +177,7 @@ Vue.component('virtual-list', {
177177
178178 render ( createElement ) {
179179 let delta = this . $options . delta ;
180- let slots = this . $slots . default ;
181- let showList = this . filter ( slots ) ;
180+ let showList = this . filter ( this . $slots . default ) ;
182181
183182 return createElement ( 'div' , {
184183 'ref' : 'container' ,
0 commit comments