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显示类型 */