Skip to content

Commit a76c429

Browse files
committed
Build v2.1.9
1 parent 32f5a55 commit a76c429

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

dist/index.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-virtual-scroll-list v2.1.8
2+
* vue-virtual-scroll-list v2.1.9
33
* open source under the MIT license
44
* https://github.com/tangbc/vue-virtual-scroll-list#readme
55
*/
@@ -151,12 +151,14 @@
151151
} // calculate the average size only in the first range
152152

153153

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+
}
160162
}
161163
} // in some special situation (e.g. length change) we need to update in a row
162164
// try goiong to render next range by a leading buffer according to current direction
@@ -363,7 +365,7 @@
363365
}, {
364366
key: "getEstimateSize",
365367
value: function getEstimateSize() {
366-
return this.firstRangeAverageSize || this.param.estimateSize;
368+
return this.isFixedType() ? this.fixedSizeValue : this.firstRangeAverageSize || this.param.estimateSize;
367369
}
368370
}]);
369371

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-virtual-scroll-list",
3-
"version": "2.1.8",
3+
"version": "2.1.9",
44
"description": "A vue component support big amount data list with high scroll performance.",
55
"main": "dist/index.js",
66
"files": [

0 commit comments

Comments
 (0)