Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

How to loop through data a certain number of times in Svelte

$
0
0

I've successfully connected my app to supabase - and it's fetching data from a table I've recently setup.

I've got the law-firm names appearing in a card template, so there's a seperate card for each h3 being pulled in.

I want to be able to loop through my database, and after fetching 4 sets of data (the law-firm name) I want to create a duplicate row underneath - fetch another 4 and continue this way (I'll sort out the pagination at a later date).

Any help would be appreciated as this is the first time I've used Svelte - and I've gone through multiple SO posts, as well as the svelte-kit documentation.

<script>    export let data;</script><ul class="flexCards">    {#each visibleLawFirms as LawF}<li class="cardShape"><h3>{LawF.lawfirmname}</h3></li>    {/each}</ul>

Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>