From 9c61026c88b95618843a6f4fefea5e83ec0b7782 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 28 Dec 2023 09:25:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=20=E8=AE=BE=E7=BD=AE=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E6=97=B6=E5=90=8C=E6=97=B6=E8=AE=BE=E7=BD=AEHTML=20lang?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useI18n.ts | 3 ++- src/store/modules/app.ts | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hooks/useI18n.ts b/src/hooks/useI18n.ts index e9bed48a..12fdec45 100644 --- a/src/hooks/useI18n.ts +++ b/src/hooks/useI18n.ts @@ -31,11 +31,12 @@ export default function useLocale() { }, ]; - // 挂载前根据默认语言在设置一次 + // 挂载前根据默认语言再设置一次 onBeforeMount(() => { const localI18n = localGet(CACHE_LOCAL_I18N); if (localI18n) { i18n.locale.value = localI18n; + document.documentElement.lang = localI18n.replace('_', '-'); } }); diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts index 2f419814..2eb5b5a8 100644 --- a/src/store/modules/app.ts +++ b/src/store/modules/app.ts @@ -15,10 +15,10 @@ type AppStore = { appVersion: string; /**服务版本 */ - version: string, - buildTime: string, + version: string; + buildTime: string; // 序列号 - serialNum: string, + serialNum: string; /**应用版权声明 */ copyright: string; /**LOGO显示类型 */