Skip to content

Commit 9937db0

Browse files
committed
Release v2.3.2
1 parent dbd4bf7 commit 9937db0

File tree

2 files changed

+43
-4
lines changed

2 files changed

+43
-4
lines changed

dist/index.js

+42-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-virtual-scroll-list v2.3.1
2+
* vue-virtual-scroll-list v2.3.2
33
* open source under the MIT license
44
* https://github.com/tangbc/vue-virtual-scroll-list#readme
55
*/
@@ -34,6 +34,39 @@
3434
return Constructor;
3535
}
3636

37+
function _toConsumableArray(arr) {
38+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
39+
}
40+
41+
function _arrayWithoutHoles(arr) {
42+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
43+
}
44+
45+
function _iterableToArray(iter) {
46+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
47+
}
48+
49+
function _unsupportedIterableToArray(o, minLen) {
50+
if (!o) return;
51+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
52+
var n = Object.prototype.toString.call(o).slice(8, -1);
53+
if (n === "Object" && o.constructor) n = o.constructor.name;
54+
if (n === "Map" || n === "Set") return Array.from(n);
55+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
56+
}
57+
58+
function _arrayLikeToArray(arr, len) {
59+
if (len == null || len > arr.length) len = arr.length;
60+
61+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
62+
63+
return arr2;
64+
}
65+
66+
function _nonIterableSpread() {
67+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
68+
}
69+
3770
/**
3871
* virtual list core calculating center
3972
*/
@@ -153,7 +186,9 @@
153186

154187
if (this.calcType !== CALC_TYPE.FIXED && typeof this.firstRangeTotalSize !== 'undefined') {
155188
if (this.sizes.size < Math.min(this.param.keeps, this.param.uniqueIds.length)) {
156-
this.firstRangeTotalSize = this.firstRangeTotalSize + size;
189+
this.firstRangeTotalSize = _toConsumableArray(this.sizes.values()).reduce(function (acc, val) {
190+
return acc + val;
191+
}, 0);
157192
this.firstRangeAverageSize = Math.round(this.firstRangeTotalSize / this.sizes.size);
158193
} else {
159194
// it's done using
@@ -190,6 +225,10 @@
190225
this.direction = offset < this.offset ? DIRECTION_TYPE.FRONT : DIRECTION_TYPE.BEHIND;
191226
this.offset = offset;
192227

228+
if (!this.param) {
229+
return;
230+
}
231+
193232
if (this.direction === DIRECTION_TYPE.FRONT) {
194233
this.handleFront();
195234
} else if (this.direction === DIRECTION_TYPE.BEHIND) {
@@ -202,7 +241,7 @@
202241
value: function handleFront() {
203242
var overs = this.getScrollOvers(); // should not change range if start doesn't exceed overs
204243

205-
if (overs > this.range.start || !this.param) {
244+
if (overs > this.range.start) {
206245
return;
207246
} // move up start by a buffer length, and make sure its safety
208247

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-virtual-scroll-list",
3-
"version": "2.3.1",
3+
"version": "2.3.2",
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)