Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@
"default": 'div'
},
wrapTag: {
type: String,
type: [Object, Function],
"default": 'div'
},
wrapClass: {
Expand Down Expand Up @@ -699,9 +699,6 @@
}
});

/**
* virtual list default component
*/
var EVENT_TYPE = {
ITEM: 'item_resize',
SLOT: 'slot_resize'
Expand Down Expand Up @@ -745,9 +742,20 @@
this.$on(EVENT_TYPE.SLOT, this.onSlotResized);
}
},
// set back offset when awake from keep-alive
activated: function activated() {
// set back offset when awake from keep-alive
this.scrollToOffset(this.virtual.offset);

if (this.pageMode) {
document.addEventListener('scroll', this.onScroll, {
passive: false
});
}
},
deactivated: function deactivated() {
if (this.pageMode) {
document.removeEventListener('scroll', this.onScroll);
}
},
mounted: function mounted() {
// set position
Expand All @@ -773,6 +781,10 @@
}
},
methods: {
// get range of shown items
getRange: function getRange() {
return this.range;
},
// get item size by id
getSize: function getSize(id) {
return this.virtual.sizes.get(id);
Expand Down Expand Up @@ -1033,6 +1045,7 @@
attrs: {
role: 'group'
},
props: _objectSpread2({}, this.extraProps),
style: wrapperStyle
}, this.getRenderSlots(h)), // footer slot
footer ? h(Slot, {
Expand Down
Loading