main.js 770 B

123456789101112131415161718192021222324252627282930313233343536
  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. // requset请求
  12. import {
  13. requestBase,
  14. requestApp,
  15. requestFile
  16. } from '@/common/api.js';
  17. // 配置文件
  18. import config from '@/config.js';
  19. import share from '@/common/share.js';
  20. // #ifdef VUE3
  21. import {
  22. createSSRApp
  23. } from 'vue'
  24. export function createApp() {
  25. const app = createSSRApp(App)
  26. app.config.globalProperties.$api = requestBase;
  27. app.config.globalProperties.$app = requestApp;
  28. app.config.globalProperties.$apifile = requestFile;
  29. app.config.globalProperties.$config = config;
  30. app.config.globalProperties.$share = share;
  31. return {
  32. app
  33. }
  34. }
  35. // #endif