main.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. // 页面跳转
  33. import { goto } from '@/utils/myfun.js';
  34. Vue.prototype.goto = goto;
  35. // 专区判断
  36. import { tidyTpye } from '@/utils/myfun.js';
  37. Vue.prototype.tidyTpye = tidyTpye;
  38. App.mpType = 'app'
  39. const app = new Vue({
  40. ...App
  41. })
  42. app.$mount()
  43. Vue.directive('focus', {
  44. inserted: (el, binding) => {
  45. if (binding.value == true || binding.value == undefined) {
  46. el.focus()
  47. }
  48. }
  49. });