remove unnecessary item wrapping (#254)
* remove unnecessary item wrapping * fix lint
This commit is contained in:
parent
82a4309454
commit
ffa5dcb3ec
|
@ -1,15 +1,15 @@
|
|||
<div class="pseudo-virtual-list" on:initialized ref:node>
|
||||
{#each wrappedItems as wrappedItem, i (wrappedItem.item)}
|
||||
{#each safeItems as item, i (item)}
|
||||
<PseudoVirtualListLazyItem
|
||||
{component}
|
||||
index={i}
|
||||
length={wrappedItems.length}
|
||||
length={safeItems.length}
|
||||
{makeProps}
|
||||
key={wrappedItem.item}
|
||||
key={item}
|
||||
{intersectionObserver}
|
||||
isIntersecting={isIntersecting(wrappedItem.item, $intersectionStates)}
|
||||
isCached={isCached(wrappedItem.item, $intersectionStates)}
|
||||
height={getHeight(wrappedItem.item, $intersectionStates)}
|
||||
isIntersecting={isIntersecting(item, $intersectionStates)}
|
||||
isCached={isCached(item, $intersectionStates)}
|
||||
height={getHeight(item, $intersectionStates)}
|
||||
/>
|
||||
{/each}
|
||||
</div>
|
||||
|
@ -110,7 +110,7 @@
|
|||
}
|
||||
},
|
||||
computed: {
|
||||
wrappedItems: ({ items }) => items ? items.map(item => ({item})) : [],
|
||||
safeItems: ({ items }) => items || [],
|
||||
allItemsHaveHeight: ({ items, $intersectionStates }) => {
|
||||
if (!items) {
|
||||
return false
|
||||
|
|
Loading…
Reference in a new issue