feat(front): integrate GlobalDayjs component for dynamic date localization and formatting

This commit is contained in:
keven
2025-10-18 10:46:07 +08:00
parent 41b0076464
commit 8924de58c0
2 changed files with 15 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
<script setup lang="ts">
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import 'dayjs/locale/en'
import 'dayjs/locale/zh-cn'
dayjs.extend(relativeTime)
const { locale } = useI18n()
watchEffect(() => {
dayjs.locale(locale.value.toLowerCase())
})
</script>

View File

@@ -5,6 +5,7 @@ await useSeo()
<template>
<div class="h-screen w-screen">
<GlobalDrawer />
<GlobalDayjs />
<Toaster position="top-center" richColors closeButton />
<img
class="w-full h-full object-cover absolute inset-0 -z-[1] bg-gradient-to-bl from-primary/40 to-primary"