import { createSSRApp } from 'vue' import App from './App' import uviewPlus from 'uview-plus' import store from './store' import config from '@/config/config' import airBtn from '@/components/m-airbtn/index.vue' import mpShare from '@/utils/mpShare.js' import * as filterUtils from './utils/filters.js' export function createApp() { const app = createSSRApp(App) app.use(store) app.use(uviewPlus) app.config.globalProperties.$store = store app.config.globalProperties.$mainColor = config.mainColor app.config.globalProperties.$lightColor = config.lightColor app.config.globalProperties.$aiderLightColor = config.aiderLightColor const filterMethods = {} Object.keys(filterUtils).forEach((key) => { if (typeof filterUtils[key] === 'function') { filterMethods[key] = filterUtils[key] } }) app.mixin({ methods: filterMethods }) app.mixin(mpShare) // #ifdef H5 if (config.enableMiniBarStartUpApp) { const mountPoint = document.createElement('div') document.body.appendChild(mountPoint) createSSRApp(airBtn).mount(mountPoint) } // #endif return { app } }