mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-10-15 18:00:47 +02:00
Use Interval to refresh data
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
<template>
|
||||
<UPageBody class="p-4 flex flex-row flex-wrap gap-6 mt-0">
|
||||
<USkeleton v-if="status !== 'success'" class="w-[240px] h-[350px]" />
|
||||
<MangaCard
|
||||
v-for="(m, i) in manga"
|
||||
v-else
|
||||
:key="m.key"
|
||||
:manga="m"
|
||||
:expanded="i === expanded"
|
||||
@@ -16,6 +14,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const { data: manga, status } = await useApi('/v2/Manga', { key: FetchKeys.Manga.All, lazy: true });
|
||||
const { data: manga, refresh } = await useApi('/v2/Manga', { key: FetchKeys.Manga.All, lazy: true });
|
||||
|
||||
onMounted(() => setInterval(refresh, 4000))
|
||||
const expanded = ref(-1);
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user