...
|
...
|
@@ -110,6 +110,7 @@ export default { |
|
|
|
|
|
if (oldList.length < 2) {
|
|
|
this._updateList();
|
|
|
this.$emit('on-inited', this._getCurrentItems());
|
|
|
}
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -319,11 +320,7 @@ export default { |
|
|
|
|
|
this.updateCurrentItems(scrollTop);
|
|
|
},
|
|
|
onScroll() {
|
|
|
const scrollTop = this.$el.scrollTop;
|
|
|
|
|
|
this.updateList();
|
|
|
|
|
|
_getCurrentItems(scrollTop = 0) {
|
|
|
let currents = [];
|
|
|
|
|
|
if (scrollTop > (this.$refs.eternal.offsetHeight - document.body.clientHeight / 2)) {
|
...
|
...
|
@@ -338,7 +335,14 @@ export default { |
|
|
}
|
|
|
}
|
|
|
|
|
|
this.$emit('scroll', {scrollTop, items: currents});
|
|
|
return currents;
|
|
|
},
|
|
|
onScroll() {
|
|
|
const scrollTop = this.$el.scrollTop;
|
|
|
|
|
|
this.updateList();
|
|
|
|
|
|
this.$emit('scroll', {scrollTop, items: this._getCurrentItems(scrollTop)});
|
|
|
},
|
|
|
},
|
|
|
components: {
|
...
|
...
|
|