We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c26eaa0 commit 29b246cCopy full SHA for 29b246c
1 file changed
MyMusicClientSveltePwa/src/lib/pages/Playlists.svelte
@@ -11,6 +11,11 @@
11
let updating = false
12
13
export let playlistId = -1;
14
+ let visibleCount = 100;
15
+
16
+ function loadMore() {
17
+ visibleCount += 100;
18
+ }
19
20
let songs = writable([]);
21
@@ -39,11 +44,16 @@
39
44
40
45
{#if $songs.length > 0}
41
46
<div class="row">
42
- {#each $songs as song}
47
+ {#each $songs.slice(0, visibleCount) as song}
43
48
<div class="col-12 col-lg-4">
49
<SongComponent {song} {playlistId} />
50
</div>
51
{/each}
52
+ {#if visibleCount < $songs.length}
53
+ <div class="col-12 text-center my-3">
54
+ <button class="btn btn-primary" on:click={loadMore}>Load More</button>
55
+ </div>
56
+ {/if}
57
58
{:else}
59
<p>No songs in playlist.</p>
0 commit comments