mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 07:08:02 +00:00
feat(front): integrate GlobalDayjs component for dynamic date localization and formatting
This commit is contained in:
14
front/components/GlobalDayjs.vue
Normal file
14
front/components/GlobalDayjs.vue
Normal 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>
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user