Skip to content

Commit

Permalink
add loading state to table
Browse files Browse the repository at this point in the history
  • Loading branch information
probablyjassin committed Oct 15, 2024
1 parent 29e1213 commit cd135d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pages/stundenplan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Zurück zu Heute
</UButton>
</span>
<UTable :rows="schedule[page - 1]" class="w-full" />
<UTable :rows="schedule[page - 1]" class="w-full" :loading="!hasLoaded"/>
<button @click="logout()" class="mt-5 p-2 bg-primary text-white rounded">Anmeldedaten zurücksetzen</button>
</div>
</ClientOnly>
Expand All @@ -36,6 +36,8 @@
const data = useState('stundenplan', (() => []));
const schedule = computed(() => Object.values(groupedByDay.value));
const hasLoaded = ref(false);
watch(groupedByDay.value, (newVal) => {
const todayIndex = Object.keys(newVal).indexOf(today.toString());
if (todayIndex !== -1) {
Expand Down Expand Up @@ -73,6 +75,8 @@
Bemerkungen: item["remarks"] || "---",
});
});
hasLoaded.value = true;
});
function logout() {
Expand Down

0 comments on commit cd135d1

Please sign in to comment.