From 02b8800bc62b40d5c901f9156bde855c075ee38d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Sat, 22 Mar 2025 09:36:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=AD=E8=A8=80=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 16 ++++++++++++---- pages.json | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/main.js b/main.js index 5fe2818..8263c30 100644 --- a/main.js +++ b/main.js @@ -23,12 +23,20 @@ import Eyu from '@/common/locales/ru.js'; // 引入并使用vue-i18n import VueI18n from 'vue-i18n' Vue.use(VueI18n) - - +let i18nConfig = { + locale: uni.getLocale(),// 获取已设置的语言 + messages: { + // 这里的属性名是任意的,您也可以把zh设置为cn等,只是后续切换语言时 + // 要标识这里的语言属性,如:this.$i18n.locale = zh|en|cn|xxx + 'zh-Hans': Chinese, + 'en': English, + 'ru': Eyu, + } +} // 构造i18n对象 const i18n = new VueI18n({ // 默认语言,这里的local属性,对应message中的cn、en属性 - locale: 'zh-Hans', + locale:uni.getLocale(), // 引入语言文件 messages: { // 这里的属性名是任意的,您也可以把zh设置为cn等,只是后续切换语言时 @@ -38,7 +46,7 @@ const i18n = new VueI18n({ 'ru': Eyu, } }) -uni.setStorageSync('i18locale', 'zh-Hans'); +// uni.setStorageSync('i18locale', 'zh-Hans'); App.mpType = 'app' Vue.prototype._i18n = i18n const app = new Vue({ diff --git a/pages.json b/pages.json index bd7f493..822ba7d 100644 --- a/pages.json +++ b/pages.json @@ -7,7 +7,7 @@ "style" : { "navigationBarTitleText": "登录", - "enablePullDownRefresh": true, + "enablePullDownRefresh": false, "navigationStyle":"custom",// 去掉微信小程序顶部导航 "app-plus":{ "titleNView":false //去掉app+h5顶部导航