main.js 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. import App from './App'
  2. import { createSSRApp } from 'vue'
  3. import store from './store'
  4. import bootstrap from './core/bootstrap'
  5. import mixin from './core/mixins/app'
  6. import uView from './uni_modules/vk-uview-ui'
  7. import { navTo, showToast, showSuccess, showError, getShareUrlParams, checkModuleKey, checkModules } from './core/app'
  8. import 'animate.css';
  9. import './colorui/wow/css/animate.min.css';
  10. // 不能修改createApp方法名,不能修改从Vue中导入的createSSRApp
  11. export function createApp() {
  12. // 创建应用实例
  13. const app = createSSRApp({ ...App, store, created: bootstrap })
  14. // 挂载全局函数
  15. app.config.globalProperties.$toast = showToast
  16. app.config.globalProperties.$success = showSuccess
  17. app.config.globalProperties.$error = showError
  18. app.config.globalProperties.$navTo = navTo
  19. app.config.globalProperties.$getShareUrlParams = getShareUrlParams
  20. app.config.globalProperties.$checkModule = checkModuleKey
  21. app.config.globalProperties.$checkModules = checkModules
  22. // 使用 uView UI
  23. app.use(uView)
  24. // 全局mixin
  25. app.mixin(mixin)
  26. return { app }
  27. }