From ff120d19df422dc6aeb7a35e144d726582aef8f8 Mon Sep 17 00:00:00 2001 From: zhangwei <1504152376@qq.com> Date: 星期三, 14 八月 2024 17:25:56 +0800 Subject: [PATCH] - --- src/main.ts | 54 ++++++++++++++++++++++++++++++++---------------------- 1 files changed, 32 insertions(+), 22 deletions(-) diff --git a/src/main.ts b/src/main.ts index 93b9c93..fc478d1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,3 +1,4 @@ + import App from './App' // vuex @@ -5,6 +6,15 @@ // 寮曞叆鍏ㄥ眬uview-plus import uviewPlus, { setConfig } from '@/uni_modules/uview-plus' +//涓婁紶鏂规硶 +import * as Upload from '@/common/utils/uploadHelper.js' +//甯哥敤鏂规硶搴� +import * as Common from '@/common/utils/commonHelper.js' +//鏈湴瀛樺偍灏佽 +import * as Db from '@/common/utils/dbHelper.js' +//鍏ㄥ眬甯搁噺閰嶇疆 +import * as GlobalConstVars from '@/common/setting/constVarsHelper.js' +import * as Http from '@/common/request/http.api.js' // i18n閮ㄥ垎鐨勯厤缃� // 寮曞叆璇█鍖咃紝娉ㄦ剰璺緞 @@ -15,14 +25,14 @@ 'zh-Hans': zhHans, } let i18nConfig = { - locale: uni.getLocale(),// 鑾峰彇宸茶缃殑璇█ - messages + locale: uni.getLocale(),// 鑾峰彇宸茶缃殑璇█ + messages } // 寮曞叆uView瀵瑰皬绋嬪簭鍒嗕韩鐨刴ixin灏佽 import mpShare from '@/uni_modules/uview-plus/libs/mixin/mpShare.js' import mixin from './common/mixin' - + // #ifdef VUE3 import { createSSRApp } from 'vue' import { createI18n } from 'vue-i18n' @@ -47,26 +57,26 @@ } }) export function createApp() { - const app = createSSRApp(App) - - // 寮曞叆璇锋眰灏佽 - initRequest(app) + const app = createSSRApp(App) - app.use(store) - .use(i18n) - .use(uviewPlus) + // 寮曞叆璇锋眰灏佽 + initRequest(app) - // #ifdef MP - app.mixin(mpShare) - app.mixin(mixin) - // #endif + app.use(store) + .use(i18n) + .use(uviewPlus) + app.config.globalProperties.$upload = Upload; + app.config.globalProperties.$common = Common; + app.config.globalProperties.$db = Db; + app.config.globalProperties.$globalConstVars = GlobalConstVars; + app.config.globalProperties.$api = Http; + // #ifdef MP + app.mixin(mpShare) + app.mixin(mixin) + // #endif - return { - app - } + return { + app + } } -// #endif - - - - +// #endif \ No newline at end of file -- Gitblit v1.9.1