Skip to content

Commit 1eb52b0

Browse files
linniksatangbc
authored andcommitted
add key for rendering items
it will increase speed of VNode-Dom comparison and patch for example for list of images when new slots added to the list only these images will requested (at this moment all 30 will be requested)
1 parent b0b0411 commit 1eb52b0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ const VirtualList = Vue.component('virtual-list', {
269269
if (dataSource) {
270270
if (Object.prototype.hasOwnProperty.call(dataSource, dataKey)) {
271271
slots.push(h(Item, {
272+
key: dataSource[dataKey],
272273
props: {
273274
index,
274275
tag: itemTag,

0 commit comments

Comments
 (0)