Skip to content

Commit 3a0301a

Browse files
committed
Build v2.1.4
1 parent bb1484b commit 3a0301a

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

dist/index.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-virtual-scroll-list v2.1.3
2+
* vue-virtual-scroll-list v2.1.4
33
* open source under the MIT license
44
* https://github.com/tangbc/vue-virtual-scroll-list#readme
55
*/
@@ -670,7 +670,8 @@
670670
var shepherd = this.$refs.shepherd;
671671

672672
if (shepherd) {
673-
shepherd.scrollIntoView(false); // check if it's really scrolled to the bottom
673+
var offset = shepherd[this.isHorizontal ? 'offsetLeft' : 'offsetTop'];
674+
this.scrollToOffset(offset); // check if it's really scrolled to the bottom
674675
// maybe list doesn't render and calculate to last range
675676
// so we need retry in next event loop until it really at bottom
676677

@@ -772,7 +773,7 @@
772773
var dataSource = dataSources[index];
773774

774775
if (dataSource) {
775-
if (dataSource[dataKey]) {
776+
if (Object.prototype.hasOwnProperty.call(dataSource, dataKey)) {
776777
slots.push(h(Item, {
777778
props: {
778779
index: index,
@@ -812,8 +813,9 @@
812813
wrapTag = this.wrapTag,
813814
wrapClass = this.wrapClass,
814815
footerClass = this.footerClass,
815-
footerTag = this.footerTag;
816-
var padding = this.isHorizontal ? "0px ".concat(padBehind, "px 0px ").concat(padFront, "px") : "".concat(padFront, "px 0px ").concat(padBehind, "px");
816+
footerTag = this.footerTag,
817+
isHorizontal = this.isHorizontal;
818+
var padding = isHorizontal ? "0px ".concat(padBehind, "px 0px ").concat(padFront, "px") : "".concat(padFront, "px 0px ").concat(padBehind, "px");
817819
return h(rootTag, {
818820
ref: 'root',
819821
on: {
@@ -846,7 +848,11 @@
846848
}
847849
}, footer) : null, // an empty element use to scroll to bottom
848850
h('div', {
849-
ref: 'shepherd'
851+
ref: 'shepherd',
852+
style: {
853+
width: isHorizontal ? '0px' : '100%',
854+
height: isHorizontal ? '100%' : '0px'
855+
}
850856
})]);
851857
}
852858
});

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.3",
3+
"version": "2.1.4",
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)