diff --git a/packages/vue-virtual-scroller/src/components/DynamicScrollerItem.vue b/packages/vue-virtual-scroller/src/components/DynamicScrollerItem.vue index e47d3256..f81d76f4 100644 --- a/packages/vue-virtual-scroller/src/components/DynamicScrollerItem.vue +++ b/packages/vue-virtual-scroller/src/components/DynamicScrollerItem.vue @@ -58,7 +58,7 @@ export default { id () { if (this.vscrollData.simpleArray) return this.index // eslint-disable-next-line no-prototype-builtins - if (this.item.hasOwnProperty(this.vscrollData.keyField)) return this.item[this.vscrollData.keyField] + if (this.vscrollData.keyField in this.item) return this.item[this.vscrollData.keyField] throw new Error(`keyField '${this.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`) },