diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json new file mode 100644 index 0000000..a81b424 --- /dev/null +++ b/.hbuilderx/launch.json @@ -0,0 +1,13 @@ +{ + "version" : "1.0", + "configurations" : [ + { + "openVueDevtools" : true, + "type" : "uni-app:app-ios" + }, + { + "openVueDevtools" : true, + "type" : "uni-app:app-android" + } + ] +} diff --git a/src/main.js b/src/main.js index 4b78d98..a0a9213 100644 --- a/src/main.js +++ b/src/main.js @@ -23,8 +23,9 @@ uni.$showTost = function (title='加载失败!',duration=1500,mask=false) { const messages = { en, - zh, + 'zh-Hans': zh, } +uni.setLocale('en') let i18nConfig = { locale: uni.getLocale(),// 获取已设置的语言 messages diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 6ae463e..1833532 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -16,7 +16,7 @@ const piniaIndex = index() onLoad(() => { - + uni.setLocale('en') }) diff --git a/vite.config.js b/vite.config.js index 3fa9863..9c2a111 100644 --- a/vite.config.js +++ b/vite.config.js @@ -10,6 +10,9 @@ export default defineConfig(({ command, mode }) => { plugins: [uni()], base: './', define: { + __VUE_I18N_FULL_INSTALL__: true, + __VUE_I18N_LEGACY_API__: true, + __INTLIFY_PROD_DEVTOOLS__: false, __APP_ENV__: env.APP_ENV, MY_APP_CONFIG: {