main.js 834 B

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