mirror of
https://github.com/ArthurDanjou/artsite.git
synced 2026-01-14 18:59:59 +01:00
fix: supprimer le chargement paresseux des données dans le composant Stats et améliorer la gestion des requêtes API
This commit is contained in:
@@ -2,9 +2,7 @@
|
||||
import type { Stats } from '~~/types'
|
||||
import { usePrecision } from '@vueuse/math'
|
||||
|
||||
const { data: stats } = await useAsyncData<Stats>('stats', () => $fetch('/api/stats'), {
|
||||
lazy: true
|
||||
})
|
||||
const { data: stats } = await useAsyncData<Stats>('stats', () => $fetch('/api/stats'))
|
||||
|
||||
const startDate = computed(() => new Date(stats.value!.coding.range.start))
|
||||
const yearsCollected = useTimeAgo(startDate).value
|
||||
|
||||
Reference in New Issue
Block a user