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
2 changes: 1 addition & 1 deletion demos/item-mode/build.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demos/variable-height/build.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demos/vfor-mode/build.js

Large diffs are not rendered by default.

26 changes: 14 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
})
},

// force render ui if using item mode.
// force render ui if using item-mode.
itemModeForceRender: function () {
if (this.item) {
this.forceRender()
Expand Down Expand Up @@ -344,11 +344,11 @@
},

// filter the shown items base on `start` and `end`.
filter: function () {
filter: function (h) {
var delta = this.delta
var slots = this.$slots.default

// item mode shoud judge from items prop.
// item-mode shoud judge from items prop.
if (this.item) {
delta.total = this.itemcount
} else {
Expand Down Expand Up @@ -380,16 +380,18 @@
delta.paddingBottom = paddingBottom
delta.offsetAll = allHeight - this.size * this.remain

var targets = []
for (var i = delta.start; i <= Math.ceil(delta.end); i++) {
// create vnode, using custom attrs binder.
var slot = this.item && this.itemprops
? this.$createElement(this.item, this.itemprops(i))
: slots[i]
targets.push(slot)
var renders = []
for (var i = delta.start; i < delta.total && i <= Math.ceil(delta.end); i++) {
var slot = null
if (this.item) {
slot = h(this.item, this.itemprops(i))
} else {
slot = slots[i]
}
renders.push(slot)
}

return targets
return renders
}
},

Expand Down Expand Up @@ -431,7 +433,7 @@
},

render: function (h) {
var list = this.filter()
var list = this.filter(h)
var delta = this.delta
var dbc = this.debounce

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-virtual-scroll-list",
"version": "1.3.3",
"version": "1.3.4",
"description": "A vue component support big amount data list with high scroll performance.",
"main": "index.js",
"files": [
Expand Down