fix: activer le chargement paresseux des données dans le composant Stats

This commit is contained in:
2026-01-04 19:23:08 +01:00
parent 56c63d8db7
commit e30d956f58
2 changed files with 7 additions and 2 deletions

View File

@@ -2,7 +2,9 @@
import type { Stats } from '~~/types'
import { usePrecision } from '@vueuse/math'
const { data: stats } = await useAsyncData<Stats>('stats', () => $fetch('/api/stats'))
const { data: stats } = await useAsyncData<Stats>('stats', () => $fetch('/api/stats'), {
lazy: true
})
const startDate = computed(() => new Date(stats.value!.coding.range.start))
const yearsCollected = useTimeAgo(startDate).value

View File

@@ -1,7 +1,10 @@
/* eslint-disable */
// Generated by Wrangler by running `wrangler types` (hash: 373e9a05bf207b93549ab53665d07e4b)
// Generated by Wrangler by running `wrangler types` (hash: 8c48032b4b2801cdbac6e8dbc9d26203)
// Runtime types generated with workerd@1.20251210.0 2025-12-13 nodejs_compat
declare namespace Cloudflare {
interface GlobalProps {
mainModule: typeof import("./.output/server/index");
}
interface Env {
CACHE: KVNamespace;
STUDIO_GITHUB_CLIENT_ID: string;