main.js 760 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import App from "./App";
  2. import Vue from "vue";
  3. // #ifndef VUE3
  4. // 阻止生产环境信息
  5. Vue.config.productionTip = false;
  6. // 配置文件
  7. import config from '@/common/config.js';
  8. Vue.prototype.$config = config;
  9. // api配置
  10. import {
  11. requestBase,
  12. requestFile
  13. } from "@/common/api.js";
  14. Vue.prototype.$api = requestBase;
  15. Vue.prototype.$apifile = requestFile;
  16. // jwt解析
  17. import weappJwt from '@/common/weapp-jwt.js';
  18. Vue.prototype.$jwt = weappJwt;
  19. // 时间组件moment
  20. import moment from 'moment';
  21. Vue.prototype.$moment = moment;
  22. App.mpType = "app";
  23. const app = new Vue({
  24. ...App
  25. });
  26. app.$mount();
  27. // #endif
  28. // #ifdef VUE3
  29. import {
  30. createSSRApp
  31. } from "vue";
  32. export function createApp() {
  33. const app = createSSRApp(App);
  34. return {
  35. app
  36. };
  37. }
  38. // #endif