diff --git a/src/utils/changeLanguage.js b/src/utils/changeLanguage.js index 8f83592..20fcdf5 100644 --- a/src/utils/changeLanguage.js +++ b/src/utils/changeLanguage.js @@ -80,6 +80,7 @@ export function useLanguage() { locale.value = lang; currentLanguage.value = lang; localStorage.setItem('language', lang); + window.location.reload(); }; // 获取浏览器语言 @@ -105,7 +106,9 @@ export function useLanguage() { // 初始化语言 const initLanguage = () => { const savedLanguage = localStorage.getItem('language') || getBrowserLanguage(); - changeLanguage(savedLanguage); + locale.value = savedLanguage; + currentLanguage.value = savedLanguage; + localStorage.setItem('language', savedLanguage); }; return { diff --git a/src/views/businessintroduction/size1440/index.vue b/src/views/businessintroduction/size1440/index.vue index 5b583ca..3d5ee39 100644 --- a/src/views/businessintroduction/size1440/index.vue +++ b/src/views/businessintroduction/size1440/index.vue @@ -152,10 +152,12 @@ onUnmounted(() => { {{ t("home.nav.businessintroduction") }}
- - - {{ currentLanguageLabel }} +
+ {{ currentLanguageLabel }} + +
@@ -665,4 +667,14 @@ onUnmounted(() => { [ref*="moveRef"] { position: relative; } +.language-arrow { + font-size: 12px; + margin-left: 4px; + color: #10263E; + transition: transform 0.3s ease; +} + +.tab-item:hover .language-arrow { + color: #8B59F7; +} diff --git a/src/views/businessintroduction/size1920/index.vue b/src/views/businessintroduction/size1920/index.vue index 5b583ca..3d5ee39 100644 --- a/src/views/businessintroduction/size1920/index.vue +++ b/src/views/businessintroduction/size1920/index.vue @@ -152,10 +152,12 @@ onUnmounted(() => { {{ t("home.nav.businessintroduction") }}
- - - {{ currentLanguageLabel }} +
+ {{ currentLanguageLabel }} + +
@@ -665,4 +667,14 @@ onUnmounted(() => { [ref*="moveRef"] { position: relative; } +.language-arrow { + font-size: 12px; + margin-left: 4px; + color: #10263E; + transition: transform 0.3s ease; +} + +.tab-item:hover .language-arrow { + color: #8B59F7; +} diff --git a/src/views/companyprofil/size1440/index.vue b/src/views/companyprofil/size1440/index.vue index 5af2a3c..c0c9e84 100644 --- a/src/views/companyprofil/size1440/index.vue +++ b/src/views/companyprofil/size1440/index.vue @@ -303,10 +303,12 @@ onUnmounted(() => { {{ t("home.nav.businessintroduction") }}
- - - {{ currentLanguageLabel }} +
+ {{ currentLanguageLabel }} + +
@@ -802,4 +804,14 @@ onUnmounted(() => { [ref*="moveRef"] { position: relative; } +.language-arrow { + font-size: 12px; + margin-left: 4px; + color: #10263E; + transition: transform 0.3s ease; +} + +.tab-item:hover .language-arrow { + color: #8B59F7; +} diff --git a/src/views/companyprofil/size1920/index.vue b/src/views/companyprofil/size1920/index.vue index 5af2a3c..c0c9e84 100644 --- a/src/views/companyprofil/size1920/index.vue +++ b/src/views/companyprofil/size1920/index.vue @@ -303,10 +303,12 @@ onUnmounted(() => { {{ t("home.nav.businessintroduction") }}
- - - {{ currentLanguageLabel }} +
+ {{ currentLanguageLabel }} + +
@@ -802,4 +804,14 @@ onUnmounted(() => { [ref*="moveRef"] { position: relative; } +.language-arrow { + font-size: 12px; + margin-left: 4px; + color: #10263E; + transition: transform 0.3s ease; +} + +.tab-item:hover .language-arrow { + color: #8B59F7; +} diff --git a/src/views/companyprofildetail/size1440/index.vue b/src/views/companyprofildetail/size1440/index.vue index 2270583..1063b1a 100644 --- a/src/views/companyprofildetail/size1440/index.vue +++ b/src/views/companyprofildetail/size1440/index.vue @@ -35,10 +35,12 @@ {{ t("home.nav.businessintroduction") }}
- - - {{ currentLanguageLabel }} +
+ {{ currentLanguageLabel }} + +
@@ -435,4 +437,14 @@ onUnmounted(() => {}); // line-height: 110px; color: #10253e; } +.language-arrow { + font-size: 12px; + margin-left: 4px; + color: #10263E; + transition: transform 0.3s ease; +} + +.tab-item:hover .language-arrow { + color: #8B59F7; +} diff --git a/src/views/companyprofildetail/size1920/index.vue b/src/views/companyprofildetail/size1920/index.vue index 2270583..1063b1a 100644 --- a/src/views/companyprofildetail/size1920/index.vue +++ b/src/views/companyprofildetail/size1920/index.vue @@ -35,10 +35,12 @@ {{ t("home.nav.businessintroduction") }}
- - - {{ currentLanguageLabel }} +
+ {{ currentLanguageLabel }} + +
@@ -435,4 +437,14 @@ onUnmounted(() => {}); // line-height: 110px; color: #10253e; } +.language-arrow { + font-size: 12px; + margin-left: 4px; + color: #10263E; + transition: transform 0.3s ease; +} + +.tab-item:hover .language-arrow { + color: #8B59F7; +} diff --git a/src/views/home/size1440/index.vue b/src/views/home/size1440/index.vue index 0634050..c1dbf55 100644 --- a/src/views/home/size1440/index.vue +++ b/src/views/home/size1440/index.vue @@ -436,10 +436,12 @@ watch( {{ t("home.nav.businessintroduction") }}
- - - {{ currentLanguageLabel }} +
+ {{ currentLanguageLabel }} + +
@@ -977,4 +979,14 @@ watch( height: 22pxpx; } } +.language-arrow { + font-size: 12px; + margin-left: 4px; + color: #10263E; + transition: transform 0.3s ease; +} + +.tab-item:hover .language-arrow { + color: #8B59F7; +} diff --git a/src/views/home/size1920/index.vue b/src/views/home/size1920/index.vue index f4ffa83..3ef6186 100644 --- a/src/views/home/size1920/index.vue +++ b/src/views/home/size1920/index.vue @@ -426,10 +426,12 @@ watch( {{ t("home.nav.businessintroduction") }}
- - - {{ currentLanguageLabel }} +
+ {{ currentLanguageLabel }} + +
@@ -941,6 +943,22 @@ watch( height: 22pxpx; } } + +.language-display { + display: flex; + align-items: center; +} + +.language-arrow { + font-size: 12px; + margin-left: 4px; + color: #10263E; + transition: transform 0.3s ease; +} + +.tab-item:hover .language-arrow { + color: #8B59F7; +}