@@ -116,28 +116,28 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
116
116
default : function _default ( ) { }
117
117
}
118
118
} ,
119
- // use alter to identify which prop change.
119
+ // use changeProp to identify which prop change.
120
120
watch : {
121
121
size : function size ( ) {
122
- this . alter = 'size' ;
122
+ this . changeProp = 'size' ;
123
123
} ,
124
124
remain : function remain ( ) {
125
- this . alter = 'remain' ;
125
+ this . changeProp = 'remain' ;
126
126
} ,
127
127
bench : function bench ( ) {
128
- this . alter = 'bench' ;
128
+ this . changeProp = 'bench' ;
129
129
this . itemModeForceRender ( ) ;
130
130
} ,
131
131
start : function start ( ) {
132
- this . alter = 'start' ;
132
+ this . changeProp = 'start' ;
133
133
this . itemModeForceRender ( ) ;
134
134
} ,
135
135
offset : function offset ( ) {
136
- this . alter = 'offset' ;
136
+ this . changeProp = 'offset' ;
137
137
this . itemModeForceRender ( ) ;
138
138
} ,
139
139
itemcount : function itemcount ( ) {
140
- this . alter = 'itemcount' ;
140
+ this . changeProp = 'itemcount' ;
141
141
this . itemModeForceRender ( ) ;
142
142
}
143
143
} ,
@@ -183,17 +183,17 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
183
183
beforeUpdate : function beforeUpdate ( ) {
184
184
var delta = this . delta ;
185
185
delta . keeps = this . remain + ( this . bench || this . remain ) ;
186
- var calcstart = this . alter === 'start' ? this . start : delta . start ;
186
+ var calcstart = this . changeProp === 'start' ? this . start : delta . start ;
187
187
var zone = this . getZone ( calcstart ) ; // if start, size or offset change, update scroll position.
188
188
189
- if ( this . alter && [ 'start' , 'size' , 'offset' ] . includes ( this . alter ) ) {
190
- var scrollTop = this . alter === 'offset' ? this . offset : this . variable ? this . getVarOffset ( zone . isLast ? delta . total : zone . start ) : zone . isLast && delta . total - calcstart <= this . remain ? delta . total * this . size : calcstart * this . size ;
189
+ if ( this . changeProp && [ 'start' , 'size' , 'offset' ] . includes ( this . changeProp ) ) {
190
+ var scrollTop = this . changeProp === 'offset' ? this . offset : this . variable ? this . getVarOffset ( zone . isLast ? delta . total : zone . start ) : zone . isLast && delta . total - calcstart <= this . remain ? delta . total * this . size : calcstart * this . size ;
191
191
this . $nextTick ( this . setScrollTop . bind ( this , scrollTop ) ) ;
192
192
} // if points out difference, force update once again.
193
193
194
194
195
- if ( this . alter || delta . end !== zone . end || calcstart !== zone . start ) {
196
- this . alter = '' ;
195
+ if ( this . changeProp || delta . end !== zone . end || calcstart !== zone . start ) {
196
+ this . changeProp = '' ;
197
197
delta . end = zone . end ;
198
198
delta . start = zone . start ;
199
199
this . forceRender ( ) ;
@@ -473,9 +473,11 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
473
473
}
474
474
} ,
475
475
render : function render ( h ) {
476
- var list = this . filter ( h ) ;
477
- var delta = this . delta ;
478
476
var dbc = this . debounce ;
477
+ var list = this . filter ( h ) ;
478
+ var _this$delta = this . delta ,
479
+ paddingTop = _this$delta . paddingTop ,
480
+ paddingBottom = _this$delta . paddingBottom ;
479
481
return h ( this . rtag , {
480
482
'ref' : 'vsl' ,
481
483
'style' : {
@@ -489,8 +491,8 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
489
491
} , [ h ( this . wtag , {
490
492
'style' : {
491
493
'display' : 'block' ,
492
- 'padding-top' : delta . paddingTop + 'px' ,
493
- 'padding-bottom' : delta . paddingBottom + 'px'
494
+ 'padding-top' : paddingTop + 'px' ,
495
+ 'padding-bottom' : paddingBottom + 'px'
494
496
} ,
495
497
'class' : this . wclass ,
496
498
'attrs' : {
0 commit comments