From 2af5f043b60c1f7ac38ecccc8f5bf44743134325 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 12 十二月 2025 18:08:00 +0800
Subject: [PATCH] test
---
main.js | 35 ++++++++++++++++++++++++++---------
1 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/main.js b/main.js
index c1a55cd..d139c77 100644
--- a/main.js
+++ b/main.js
@@ -1,26 +1,43 @@
import App from './App'
-
+// i18n
+import messages from './locale'
+const i18nConfig = {
+ locale: uni.getLocale(),
+ messages
+}
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
+import VueI18n from 'vue-i18n'
Vue.config.productionTip = false
+const i18n = new VueI18n(i18nConfig)
App.mpType = 'app'
const app = new Vue({
- ...App
+ ...App,
+ i18n,
})
app.$mount()
// #endif
// #ifdef VUE3
-import { createSSRApp } from 'vue'
-import {Button} from 'antd-mobile-vue-next'
+import {
+ createSSRApp
+} from 'vue'
+import {
+ Button
+} from 'antd-mobile-vue-next'
+import {
+ createI18n
+} from 'vue-i18n'
+const i18n = new createI18n(i18nConfig)
export function createApp() {
- const app = createSSRApp(App)
-app.use(Button)
- return {
- app
- }
+ const app = createSSRApp(App)
+ app.use(i18n)
+ app.use(Button)
+ return {
+ app
+ }
}
// #endif
\ No newline at end of file
--
Gitblit v1.9.1