22import { computed , reactive , ref , watchEffect } from ' vue' ;
33
44import { IcRoundLock } from ' @vben-core/iconify' ;
5- import { $t } from ' @vben-core/locales' ;
5+ import { $t , useI18n } from ' @vben-core/locales' ;
66import {
77 VbenAvatar ,
88 VbenButton ,
@@ -27,14 +27,13 @@ const props = withDefaults(defineProps<Props>(), {
2727
2828const emit = defineEmits <{ toLogin: []; unlock: [string ] }>();
2929
30+ const { locale } = useI18n ();
31+
3032const now = useNow ();
31- const year = useDateFormat (now , ' YYYY' );
32- const month = useDateFormat (now , ' MM' );
33- const day = useDateFormat (now , ' DD' );
34- const week = useDateFormat (now , ' dddd' );
35- const hour = useDateFormat (now , ' HH' );
3633const meridiem = useDateFormat (now , ' A' );
34+ const hour = useDateFormat (now , ' HH' );
3735const minute = useDateFormat (now , ' mm' );
36+ const date = useDateFormat (now , ' YYYY-MM-DD dddd' , { locales: locale .value });
3837
3938const showUnlockForm = ref (false );
4039const validPass = ref (true );
@@ -102,9 +101,9 @@ function toggleUnlockForm() {
102101 <div
103102 class =" bg-accent flex-center relative mb-14 mr-20 h-4/5 w-2/5 flex-auto rounded-3xl text-center text-[260px]"
104103 >
105- <span class =" absolute left-4 top-4 text-xl font-semibold" >{{
106- meridiem
107- }} </span >
104+ <span class =" absolute left-4 top-4 text-xl font-semibold" >
105+ {{ meridiem }}
106+ </span >
108107 {{ hour }}
109108 </div >
110109 <div
@@ -124,7 +123,7 @@ function toggleUnlockForm() {
124123 >
125124 <div class =" flex-col-center mb-10 w-[300px]" >
126125 <VbenAvatar :src =" avatar" class =" enter-x mb-6 size-20" />
127- <div class =" items-cente enter-x mb-2 w-full" >
126+ <div class =" enter-x mb-2 w-full items-center " >
128127 <VbenInputPassword
129128 v-model =" formState.password"
130129 :autofocus =" true"
@@ -164,7 +163,7 @@ function toggleUnlockForm() {
164163 <div v-if =" showUnlockForm" class =" enter-x mb-2 text-3xl" >
165164 {{ hour }}:{{ minute }} <span class =" text-lg" >{{ meridiem }}</span >
166165 </div >
167- <div class =" text-3xl" >{{ year }}/{{ month }}/{{ day }} {{ week }}</div >
166+ <div class =" text-3xl" >{{ date }}</div >
168167 </div >
169168 </div >
170169</template >
0 commit comments