import App from './App' // vuex import store from '@/store/index.js' // uviewPlus导入 import uviewPlus from '@/uni_modules/uview-plus' import bootstrap from './core/bootstrap' import {isLogin,isEmpty,navTo,getRegistrationID,parsePhone} from '@/utils/util.js' // 全局 mixin import share from './core/mixins/share.js' import mixin from './core/mixins/app' // #ifndef VUE3 import Vue from 'vue' import './uni.promisify.adaptor' Vue.config.productionTip = false Vue.prototype.$img = { img: '/static/images/img.png', // 默认图片 logo: '/static/images/logo.png', // 其他公共图片 } Vue.prototype.$isLogin = isLogin; Vue.prototype.$isEmpty = isEmpty; Vue.prototype.$navTo = navTo; Vue.prototype.$getRegistrationID = getRegistrationID; Vue.prototype.$parsePhone = parsePhone; App.mpType = 'app' const app = new Vue({ ...App }) app.$mount() // #endif // #ifdef VUE3 import { createSSRApp } from 'vue' export function createApp() { const app = createSSRApp(App) // 注册组件库和vuex app.use(uviewPlus).use(store) app.config.productionTip = false // 定义全局变量 $img(Vue3 方式) app.config.globalProperties.$img = { img: '/static/images/img.png', // 默认图片 logo: '/static/images/logo.png', // 其他公共图片 } app.config.globalProperties.$isLogin = isLogin app.config.globalProperties.$isEmpty = isEmpty app.config.globalProperties.$navTo = navTo app.config.globalProperties.$getRegistrationID = getRegistrationID app.config.globalProperties.$parsePhone = parsePhone // 全局 mixin app.mixin(share).mixin(mixin) return { app, created: bootstrap } } // #endif