main.js 828 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import App from './App'
  2. // #ifndef VUE3
  3. import Vue from 'vue'
  4. Vue.config.productionTip = false
  5. App.mpType = 'app'
  6. const app = new Vue({
  7. ...App
  8. })
  9. app.$mount()
  10. // #endif
  11. import uviewPlus from 'uview-plus';
  12. // requset请求
  13. import {
  14. requestBase,
  15. requestApp,
  16. requestFile
  17. } from '@/common/api.js';
  18. // 配置文件
  19. import config from '@/config.js';
  20. import share from '@/common/share.js';
  21. // #ifdef VUE3
  22. import {
  23. createSSRApp
  24. } from 'vue'
  25. export function createApp() {
  26. const app = createSSRApp(App)
  27. app.use(uviewPlus)
  28. app.config.globalProperties.$api = requestBase;
  29. app.config.globalProperties.$app = requestApp;
  30. app.config.globalProperties.$apifile = requestFile;
  31. app.config.globalProperties.$config = config;
  32. app.config.globalProperties.$share = share;
  33. return {
  34. app
  35. }
  36. }
  37. // #endif