From 8cb35f4f1b3f6d8c3f7f58a4cff99c95fcd8405b Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Thu, 23 Jan 2025 14:25:30 +0800 Subject: [PATCH] 12 --- app/constants/{index.ts => index.js} | 0 app/plugins/{http.ts => http.js} | 0 app/plugins/{i18n.ts => i18n.js} | 8 +++----- app/plugins/{vconsole.client.ts => vconsole.client.js} | 0 app/static/styles/global.css | 0 app/static/styles/vars.css | 0 6 files changed, 3 insertions(+), 5 deletions(-) rename app/constants/{index.ts => index.js} (100%) rename app/plugins/{http.ts => http.js} (100%) rename app/plugins/{i18n.ts => i18n.js} (85%) rename app/plugins/{vconsole.client.ts => vconsole.client.js} (100%) delete mode 100644 app/static/styles/global.css delete mode 100644 app/static/styles/vars.css diff --git a/app/constants/index.ts b/app/constants/index.js similarity index 100% rename from app/constants/index.ts rename to app/constants/index.js diff --git a/app/plugins/http.ts b/app/plugins/http.js similarity index 100% rename from app/plugins/http.ts rename to app/plugins/http.js diff --git a/app/plugins/i18n.ts b/app/plugins/i18n.js similarity index 85% rename from app/plugins/i18n.ts rename to app/plugins/i18n.js index ad5fb7c..127eda7 100644 --- a/app/plugins/i18n.ts +++ b/app/plugins/i18n.js @@ -1,4 +1,4 @@ -import type { Locale as TypeLocale } from '#i18n' + import { Locale } from 'vant' import enUS from 'vant/es/locale/lang/en-US' import zhCN from 'vant/es/locale/lang/zh-CN' @@ -6,7 +6,7 @@ import jaJP from 'vant/es/locale/lang/ja-JP' import zhTW from 'vant/es/locale/lang/zh-TW' export default defineNuxtPlugin(() => { - // 载入 vant 语言包 + Locale.use('zh-CN', zhCN) Locale.use('en-US', enUS) Locale.use('ja-JP', jaJP) @@ -15,11 +15,9 @@ export default defineNuxtPlugin(() => { if (import.meta.client) { const i18n = useNuxtApp().$i18n const { setLocale } = i18n - const lang = localStorage.getItem('lang') - if (lang) { - setLocale(lang as TypeLocale) + setLocale(lang) Locale.use(lang) } else { diff --git a/app/plugins/vconsole.client.ts b/app/plugins/vconsole.client.js similarity index 100% rename from app/plugins/vconsole.client.ts rename to app/plugins/vconsole.client.js diff --git a/app/static/styles/global.css b/app/static/styles/global.css deleted file mode 100644 index e69de29..0000000 diff --git a/app/static/styles/vars.css b/app/static/styles/vars.css deleted file mode 100644 index e69de29..0000000