Skip to content

Commit 1559ca8

Browse files
fix: keyField issue for class instances, fix #770 (#771)
1 parent 7c809ad commit 1559ca8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/vue-virtual-scroller/src/components/DynamicScrollerItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default {
5858
id () {
5959
if (this.vscrollData.simpleArray) return this.index
6060
// eslint-disable-next-line no-prototype-builtins
61-
if (this.item.hasOwnProperty(this.vscrollData.keyField)) return this.item[this.vscrollData.keyField]
61+
if (this.vscrollData.keyField in this.item) return this.item[this.vscrollData.keyField]
6262
throw new Error(`keyField '${this.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`)
6363
},
6464

0 commit comments

Comments
 (0)