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>
|
<div class="pseudo-virtual-list" on:initialized ref:node>
|
||||||
{#each wrappedItems as wrappedItem, i (wrappedItem.item)}
|
{#each safeItems as item, i (item)}
|
||||||
<PseudoVirtualListLazyItem
|
<PseudoVirtualListLazyItem
|
||||||
{component}
|
{component}
|
||||||
index={i}
|
index={i}
|
||||||
length={wrappedItems.length}
|
length={safeItems.length}
|
||||||
{makeProps}
|
{makeProps}
|
||||||
key={wrappedItem.item}
|
key={item}
|
||||||
{intersectionObserver}
|
{intersectionObserver}
|
||||||
isIntersecting={isIntersecting(wrappedItem.item, $intersectionStates)}
|
isIntersecting={isIntersecting(item, $intersectionStates)}
|
||||||
isCached={isCached(wrappedItem.item, $intersectionStates)}
|
isCached={isCached(item, $intersectionStates)}
|
||||||
height={getHeight(wrappedItem.item, $intersectionStates)}
|
height={getHeight(item, $intersectionStates)}
|
||||||
/>
|
/>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
@ -110,7 +110,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
wrappedItems: ({ items }) => items ? items.map(item => ({item})) : [],
|
safeItems: ({ items }) => items || [],
|
||||||
allItemsHaveHeight: ({ items, $intersectionStates }) => {
|
allItemsHaveHeight: ({ items, $intersectionStates }) => {
|
||||||
if (!items) {
|
if (!items) {
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in a new issue