From 17e42d4e0fa95c7af0173be4ef4768eeb6090d5f Mon Sep 17 00:00:00 2001
From: chengkun <chengkun@ishangstudy.com>
Date: Mon, 15 Sep 2025 14:43:34 +0800
Subject: [PATCH] 提交
---
public/static/vue/mixin.js | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/public/static/vue/mixin.js b/public/static/vue/mixin.js
index 220d187..942b5cc 100644
--- a/public/static/vue/mixin.js
+++ b/public/static/vue/mixin.js
@@ -14,18 +14,18 @@
{ id: 2, name_loc: 'English', symbol: 'en-us' },
// { id: 3, name_loc: 'ar', symbol: 'ar' },
],
- currentLang: '',
+ currentLang: 'zh-cn',
i18n: i18n.global, // 引入i18n实例
}
},
// 生命周期 - 创建完成(可以访问当前this实例)
mounted() {
+ this.currentLang = this.i18n.locale || 'zh-cn';
},
// 创建生命周期
created() {
- this.currentLang = this.i18n.locale || 'zh-cn';
},
// 方法
@@ -33,8 +33,10 @@
///// 切换语言 /////
changeLanguage(newLang) {
this.i18n.locale = newLang;
- this.i18n.currentLocale = newLang;
+ // this.i18n.currentLocale = newLang;
+ this.currentLocale = newLang;
localStorage.setItem('changjiang-park-lang', newLang);
+ window.location.reload();
},
}
}
\ No newline at end of file
--
Gitblit v1.9.0