31 lines
1.1 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import App from './App'
import { createSSRApp } from 'vue'
import store from './store'
import bootstrap from './core/bootstrap'
import mixin from './core/mixins/app'
import uView from './uni_modules/vk-uview-ui'
import { navTo, goPageByToken, showToast, showSuccess, showError, getShareUrlParams, checkModuleKey, checkModules } from './core/app'
// 不能修改createApp方法名不能修改从Vue中导入的createSSRApp
export function createApp() {
// 创建应用实例
const app = createSSRApp({ ...App, store, created: bootstrap })
// 挂载全局函数
app.config.globalProperties.$toast = showToast
app.config.globalProperties.$success = showSuccess
app.config.globalProperties.$error = showError
app.config.globalProperties.$navTo = navTo
app.config.globalProperties.$goPageByToken = goPageByToken
app.config.globalProperties.$getShareUrlParams = getShareUrlParams
app.config.globalProperties.$checkModule = checkModuleKey
app.config.globalProperties.$checkModules = checkModules
// 使用 uView UI
app.use(uView)
// 全局mixin
app.mixin(mixin)
return { app }
}