main.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import Vue from 'vue'
  2. import App from './App'
  3. Vue.config.productionTip = false
  4. // import uView from "uview-ui";
  5. // Vue.use(uView);
  6. // 此文件配置进入app即运行的方法
  7. import "@/utils/run_now.js";
  8. // require('@/utils/run_now.js');
  9. import "@/static/font/DIN/din.css";
  10. import md5 from 'js-md5';
  11. Vue.prototype.$md5 = md5;
  12. import dayjs from 'dayjs';
  13. Vue.prototype.$day = dayjs;
  14. import cof from '@/static/config/in';
  15. Vue.prototype.$cof = cof;
  16. // 微信全局分享
  17. import share from '@/utils/share.js'
  18. Vue.mixin(share)
  19. // js高精度计算
  20. import highPrecision from "@/utils/highPrecision";
  21. Vue.prototype.$h = highPrecision;
  22. // 自动适配接口域名
  23. import hosts from "@/request/config";
  24. Vue.prototype.$hosts = hosts;
  25. // 缓存封装
  26. import { setCache, getCache } from "@/utils/storage.js"
  27. Vue.prototype.setCache = setCache;
  28. Vue.prototype.getCache = getCache;
  29. // 上传
  30. import { up } from "@/utils/up";
  31. Vue.prototype.$up = up;
  32. import { goto, tidyTpye, hotelStarf } from '@/utils/myfun.js';
  33. Vue.prototype.goto = goto; // 页面跳转
  34. Vue.prototype.tidyTpye = tidyTpye; // 专区判断
  35. Vue.prototype.hotelStarF = hotelStarf; // 酒店星级判断
  36. App.mpType = 'app'
  37. const app = new Vue({
  38. ...App
  39. })
  40. app.$mount()
  41. Vue.directive('focus', {
  42. inserted: (el, binding) => {
  43. if (binding.value == true || binding.value == undefined) {
  44. el.focus()
  45. }
  46. }
  47. });