From 13bd96fcd106e91a76f198d1d4513801b2799a56 Mon Sep 17 00:00:00 2001 From: lvxiaohui <34181974+cy-biggray@users.noreply.github.com> Date: Wed, 8 May 2024 17:48:32 +0800 Subject: [PATCH] Update index.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 现在生成的虚拟列表没有key值,每次滑动时,vue都需要更新。 --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index a3bf684..6437f19 100644 --- a/src/index.js +++ b/src/index.js @@ -302,6 +302,7 @@ const VirtualList = Vue.component('virtual-list', { slotComponent: slotComponent, scopedSlots: itemScopedSlots }, + key: uniqueKey, style: itemStyle, class: `${itemClass}${this.itemClassAdd ? ' ' + this.itemClassAdd(index) : ''}` }))