main.js 518 B

123456789101112131415161718192021222324252627
  1. import App from './App'
  2. import http from './utils/request.js'
  3. // #ifndef VUE3
  4. import Vue from 'vue'
  5. import './uni.promisify.adaptor'
  6. Vue.config.productionTip = false
  7. // 全局挂载请求工具
  8. Vue.prototype.$http = http
  9. App.mpType = 'app'
  10. const app = new Vue({
  11. ...App
  12. })
  13. app.$mount()
  14. // #endif
  15. // #ifdef VUE3
  16. import { createSSRApp } from 'vue'
  17. export function createApp() {
  18. const app = createSSRApp(App)
  19. // 全局挂载请求工具
  20. app.config.globalProperties.$http = http
  21. return {
  22. app
  23. }
  24. }
  25. // #endif