From 52e3d034806bafbc3a2b24d208231e568cf8ed12 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期二, 25 十一月 2025 17:27:36 +0800
Subject: [PATCH] #
---
main.js | 66 +++++++++++----------------------
1 files changed, 22 insertions(+), 44 deletions(-)
diff --git a/main.js b/main.js
index e40b387..6e0bb1c 100644
--- a/main.js
+++ b/main.js
@@ -1,59 +1,37 @@
import App from './App'
+import messages from './locale/index.js'
+
+let i18nConfig = {
+ locale: uni.getLocale(), // 鑾峰彇宸茶缃殑璇█
+ messages
+}
// #ifndef VUE3
import Vue from 'vue'
+import './uni.promisify.adaptor'
Vue.config.productionTip = false
-
-import '@/common/bluetooth.js';
-//鍏ㄥ眬鏁版嵁鐘舵�佺鐞� vuex
-import store from '@/store/index.js';
-Vue.prototype.$store = store;
-//鍏ㄥ眬鍏敤闈欐�佹暟鎹�
-import Mock from '@/common/mock/index.js';
-Vue.prototype.$Mock = Mock;
-
App.mpType = 'app'
-
-try {
- function isPromise(obj) {
- return (
- !!obj &&
- (typeof obj === "object" || typeof obj === "function") &&
- typeof obj.then === "function"
- );
- }
-
- // 缁熶竴 vue2 API Promise 鍖栬繑鍥炴牸寮忎笌 vue3 淇濇寔涓�鑷�
- uni.addInterceptor({
- returnValue(res) {
- if (!isPromise(res)) {
- return res;
- }
- return new Promise((resolve, reject) => {
- res.then((res) => {
- if (res[0]) {
- reject(res[0]);
- } else {
- resolve(res[1]);
- }
- });
- });
- },
- });
-} catch (error) { }
-
+import VueI18n from 'vue-i18n'
+Vue.use(VueI18n)
+const i18n = new VueI18n(i18nConfig)
const app = new Vue({
- ...App
+ ...App,
+ i18n
})
app.$mount()
// #endif
+import uView from '@/uni_modules/uview-ui'
+Vue.use(uView)
+
// #ifdef VUE3
-import { createSSRApp } from 'vue'
+import {
+ createSSRApp
+} from 'vue'
export function createApp() {
- const app = createSSRApp(App)
- return {
- app
- }
+ const app = createSSRApp(App)
+ return {
+ app
+ }
}
// #endif
\ No newline at end of file
--
Gitblit v1.9.1