main.js 641 B

1234567891011121314151617181920212223242526272829303132333435
  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. // main.js 文件
  10. import uView from "uview-ui";
  11. Vue.use(uView);
  12. import {myRequest} from './util/api.js'
  13. Vue.prototype.$myRequest=myRequest
  14. // 引入store
  15. import store from './store'
  16. // 把vuex定义成全局组件
  17. Vue.prototype.$store = store
  18. import config from "./util/url.js"
  19. Vue.prototype.baseUrl = config.baseUrl
  20. app.$mount()
  21. // #endif
  22. // #ifdef VUE3
  23. import { createSSRApp } from 'vue'
  24. export function createApp() {
  25. const app = createSSRApp(App)
  26. return {
  27. app
  28. }
  29. }
  30. // #endif