perf: improve initial virtual list render speed by calculating height once
This commit is contained in:
4 files changed
+57
-29
No files matched your search
@@ -50,6 +50,7 @@
|
||||
let hasMore = $state(true)
|
||||
|
||||
async function loadMore() {
|
||||
console.log(hasMore, loading)
|
||||
if (!hasMore || loading) return
|
||||
|
||||
try {
|
||||
@@ -255,7 +256,14 @@
|
||||
</EndPlaceholder>
|
||||
</div>
|
||||
{/if}
|
||||
<InfiniteScroll window threshold={1000} on:loadMore={loadMore} />
|
||||
<InfiniteScroll
|
||||
window
|
||||
threshold={600}
|
||||
on:loadMore={() => {
|
||||
console.log('loadMore triggered')
|
||||
loadMore()
|
||||
}}
|
||||
/>
|
||||
{/if}
|
||||
{@render children?.()}
|
||||
</ul>
|
||||
|
||||
Reference in new issue
Block a user