main.js 687 B

1234567891011121314151617181920212223242526272829303132333435
  1. import App from './App'
  2. import uView from './uni_modules/uview-ui'
  3. import request from './utils/request.js'
  4. import apiUrl from './utils/apiUrl.js'
  5. import localStorage from './utils/storage.js'
  6. // #ifndef VUE3
  7. import Vue from 'vue'
  8. Vue.config.productionTip = false
  9. App.mpType = 'app'
  10. const app = new Vue({
  11. ...App,
  12. })
  13. Vue.use({
  14. install(Vue, options) {
  15. Vue.prototype.$request = request; // 请求
  16. Vue.prototype.$api = apiUrl; // 请求地址
  17. Vue.prototype.$storage = localStorage;
  18. }
  19. });
  20. Vue.use(uView)
  21. app.$mount()
  22. // #endif
  23. // #ifdef VUE3
  24. import { createSSRApp } from 'vue'
  25. export function createApp() {
  26. const app = createSSRApp(App)
  27. return {
  28. app
  29. }
  30. }
  31. // #endif