File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 1
1
/*!
2
- * vue-virtual-scroll-list v2.1.8
2
+ * vue-virtual-scroll-list v2.1.9
3
3
* open source under the MIT license
4
4
* https://github.com/tangbc/vue-virtual-scroll-list#readme
5
5
*/
151
151
} // calculate the average size only in the first range
152
152
153
153
154
- if ( this . sizes . size <= this . param . keeps ) {
155
- this . firstRangeTotalSize = this . firstRangeTotalSize + size ;
156
- this . firstRangeAverageSize = Math . round ( this . firstRangeTotalSize / this . sizes . size ) ;
157
- } else {
158
- // it's done using
159
- delete this . firstRangeTotalSize ;
154
+ if ( this . calcType !== CALC_TYPE . FIXED && typeof this . firstRangeTotalSize !== 'undefined' ) {
155
+ if ( this . sizes . size < Math . min ( this . param . keeps , this . param . uniqueIds . length ) ) {
156
+ this . firstRangeTotalSize = this . firstRangeTotalSize + size ;
157
+ this . firstRangeAverageSize = Math . round ( this . firstRangeTotalSize / this . sizes . size ) ;
158
+ } else {
159
+ // it's done using
160
+ delete this . firstRangeTotalSize ;
161
+ }
160
162
}
161
163
} // in some special situation (e.g. length change) we need to update in a row
162
164
// try goiong to render next range by a leading buffer according to current direction
363
365
} , {
364
366
key : "getEstimateSize" ,
365
367
value : function getEstimateSize ( ) {
366
- return this . firstRangeAverageSize || this . param . estimateSize ;
368
+ return this . isFixedType ( ) ? this . fixedSizeValue : this . firstRangeAverageSize || this . param . estimateSize ;
367
369
}
368
370
} ] ) ;
369
371
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-virtual-scroll-list" ,
3
- "version" : " 2.1.8 " ,
3
+ "version" : " 2.1.9 " ,
4
4
"description" : " A vue component support big amount data list with high scroll performance." ,
5
5
"main" : " dist/index.js" ,
6
6
"files" : [
You can’t perform that action at this time.
0 commit comments