Skip to content

Commit fd24e0a

Browse files
committed
Use key in item component
1 parent 33eda19 commit fd24e0a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/item.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ export const Item = Vue.component('virtual-list-item', {
5151
props: ItemProps,
5252

5353
render (h) {
54-
const { tag, component, extraProps = {}, index, scopedSlots = {} } = this
54+
const { tag, component, extraProps = {}, index, scopedSlots = {}, uniqueKey } = this
5555
extraProps.source = this.source
5656
extraProps.index = index
5757

5858
return h(tag, {
59+
key: uniqueKey,
5960
attrs: {
6061
role: 'item'
6162
}
@@ -76,6 +77,7 @@ export const Slot = Vue.component('virtual-list-slot', {
7677
const { tag, uniqueKey } = this
7778

7879
return h(tag, {
80+
key: uniqueKey,
7981
attrs: {
8082
role: uniqueKey
8183
}

0 commit comments

Comments
 (0)