main.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. require('@/utils/run_now.js');
  8. import "@/static/font/DIN/din.css";
  9. import md5 from 'js-md5';
  10. Vue.prototype.$md5 = md5;
  11. import dayjs from 'dayjs';
  12. Vue.prototype.$day = dayjs;
  13. import cof from '@/static/config/in';
  14. Vue.prototype.$cof = cof;
  15. // 微信全局分享
  16. import share from '@/utils/share.js'
  17. Vue.mixin(share)
  18. // js高精度计算
  19. import highPrecision from "@/utils/highPrecision";
  20. Vue.prototype.$h = highPrecision;
  21. // 自动适配接口域名
  22. import hosts from "@/request/config";
  23. Vue.prototype.$hosts = hosts;
  24. // 上传
  25. import { up } from "@/utils/up";
  26. Vue.prototype.$up = up;
  27. // 页面跳转
  28. import { goto } from '@/utils/myfun.js';
  29. Vue.prototype.goto = goto;
  30. // 专区判断
  31. import { tidyTpye } from '@/utils/myfun.js';
  32. Vue.prototype.tidyTpye = tidyTpye;
  33. App.mpType = 'app'
  34. const app = new Vue({
  35. ...App
  36. })
  37. app.$mount()
  38. Array.prototype.indexOf = function (val) {
  39. for (var i = 0; i < this.length; i++) {
  40. if (this[i] == val) return i;
  41. }
  42. return -1;
  43. };
  44. Array.prototype.remove = function (val) {
  45. var index = this.indexOf(val);
  46. if (index > -1) {
  47. this.splice(index, 1);
  48. }
  49. };
  50. Vue.directive('focus', {
  51. inserted: (el, binding) => {
  52. if (binding.value == true || binding.value == undefined) {
  53. el.focus()
  54. }
  55. }
  56. });