From 44a4c9346bcd97be32292ed86e4ac190b48c165c Mon Sep 17 00:00:00 2001 From: hb0730 <1278032416@qq.com> Date: Tue, 16 Nov 2021 09:53:46 +0800 Subject: [PATCH] fix: i18n (#110) --- src/layout/components/navbar.vue | 4 ++-- src/layout/components/sidebar/breadCrumb.vue | 9 +++------ src/layout/components/sidebar/sidebarItem.vue | 18 +++++++++++------- src/layout/components/tag/index.vue | 5 ++++- src/layout/types.ts | 2 ++ src/router/index.ts | 4 ++-- src/utils/i18n.ts | 4 ++-- 7 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/layout/components/navbar.vue b/src/layout/components/navbar.vue index badaaf0b5..17da9d322 100644 --- a/src/layout/components/navbar.vue +++ b/src/layout/components/navbar.vue @@ -10,7 +10,7 @@ import { unref, watch, getCurrentInstance } from "vue"; import { deviceDetection } from "/@/utils/deviceDetection"; import screenfull from "../components/screenfull/index.vue"; import globalization from "/@/assets/svg/globalization.svg"; -import { getMessage } from "/@/utils/i18n"; +import { transformI18n } from "/@/utils/i18n"; const instance = getCurrentInstance().appContext.config.globalProperties.$storage; @@ -24,7 +24,7 @@ watch( () => locale.value, () => { //@ts-ignore - document.title = getMessage( + document.title = transformI18n( //@ts-ignore unref(route.meta.title), unref(route.meta.i18n) diff --git a/src/layout/components/sidebar/breadCrumb.vue b/src/layout/components/sidebar/breadCrumb.vue index 6d3df2e78..393b147de 100644 --- a/src/layout/components/sidebar/breadCrumb.vue +++ b/src/layout/components/sidebar/breadCrumb.vue @@ -1,7 +1,7 @@