From c8804abb431c26979c5f96cc1becd79a14c34188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=97=8B?= <723607471@qq.com> Date: Fri, 31 Mar 2023 14:18:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/navBars/breadcrumb/user.vue | 35 +++++++++++++++++++++++--- src/layout/navMenu/vertical.vue | 7 +++--- src/router/route.js | 12 +++++++++ src/store/index.ts | 19 -------------- src/store/store_name.ts | 4 --- src/stores/translate.js | 12 +++++++++ 6 files changed, 60 insertions(+), 29 deletions(-) delete mode 100644 src/store/index.ts delete mode 100644 src/store/store_name.ts create mode 100644 src/stores/translate.js diff --git a/src/layout/navBars/breadcrumb/user.vue b/src/layout/navBars/breadcrumb/user.vue index f84f661..f7d7982 100644 --- a/src/layout/navBars/breadcrumb/user.vue +++ b/src/layout/navBars/breadcrumb/user.vue @@ -11,7 +11,7 @@ 小型 - +
@@ -59,6 +59,22 @@ + +
+ +
+ +
@@ -74,10 +90,22 @@ import { useThemeConfig } from '/@/stores/themeConfig'; import mittBus from '/@/utils/mitt'; import { Session, Local } from '/@/utils/storage'; import { refreshToken } from '/@/api/system/user.js' +import { useTranslate } from '/@/stores/translate'; +import other from '/@/utils/other'; // 引入组件 const UserNews = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/userNews.vue')); const Search = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/search.vue')); - +const useTranslateStore=useTranslate() +const onLanguageChange = (lang) => { + if(lang=="en"){ + state.disabledI18n="en" + useTranslateStore.translate_control=0 + } + else{ + state.disabledI18n="zh-cn" + useTranslateStore.translate_control=1 + } +}; // 定义变量内容 const router = useRouter(); const stores = useUserInfo(); @@ -89,7 +117,8 @@ const searchRef = ref(); const state = reactive({ isScreenfull: false, disabledSize: 'large', - setIntervalId: null + setIntervalId: null, + disabledI18n:"en", }); // 设置分割样式 diff --git a/src/layout/navMenu/vertical.vue b/src/layout/navMenu/vertical.vue index 1bf1d39..083b13c 100644 --- a/src/layout/navMenu/vertical.vue +++ b/src/layout/navMenu/vertical.vue @@ -11,7 +11,7 @@ @@ -19,7 +19,7 @@