diff options
| author | Kenimarru <[email protected]> | 2024-01-08 19:58:12 +0100 |
|---|---|---|
| committer | Kenimarru <[email protected]> | 2024-01-08 19:58:12 +0100 |
| commit | 4084445a3c1efb825c2adde086cb4d40c9ba9f7a (patch) | |
| tree | cfa45e3ef5a652a38240d44bbbc77ff46a99f508 /pages | |
| parent | v0.3.2 (diff) | |
| download | hiruku-4084445a3c1efb825c2adde086cb4d40c9ba9f7a.tar.xz hiruku-4084445a3c1efb825c2adde086cb4d40c9ba9f7a.zip | |
v0.4.0
Diffstat (limited to 'pages')
| -rw-r--r-- | pages/index.vue | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/pages/index.vue b/pages/index.vue index 7e53f51..cb51ea2 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1,15 +1,22 @@ <template> + <Featured :data="data.featured" /> <section class="space-y-4"> - <Cards title="Trending Now" description="Currently Trending Anime" :data="trending" /> - <Cards title="All Time Popular" description="Most Popular Anime" :data="popular" /> - <Cards title="Upcoming Next Season" description="Upcoming Anime" :data="upcoming" /> - <Top title="Top 10 Anime" description="Top High Rated Anime" :data="top" /> + <Cards title="Trending Now" description="Currently Trending Anime" :data="data.trending" /> + <Cards title="All Time Popular" description="Most Popular Anime" :data="data.popular" /> + <Cards title="Upcoming Next Season" description="Upcoming Anime" :data="data.upcoming" /> + <Cards title="Top 10 Anime" description="Top High Rated Anime" :data="data.top" /> </section> </template> <script setup> -const { data: trending } = await useFetch("/api/trending"); -const { data: popular } = await useFetch("/api/popular"); -const { data: upcoming } = await useFetch("/api/upcoming"); -const { data: top } = await useFetch("/api/top"); +const { data } = await useAsyncData("data", async () => { + const [featured, trending, popular, upcoming, top] = await Promise.all([ + $fetch("/api/featured"), + $fetch("/api/trending"), + $fetch("/api/popular"), + $fetch("/api/upcoming"), + $fetch("/api/top") + ]); + return { featured, trending, popular, upcoming, top } +}); </script>
\ No newline at end of file |