main.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. import md5 from 'js-md5';
  7. Vue.prototype.$md5 = md5;
  8. import dayjs from 'dayjs';
  9. Vue.prototype.$day = dayjs;
  10. // 微信全局分享
  11. import share from '@/utils/share.js'
  12. Vue.mixin(share)
  13. import cof from '@/static/config/in';
  14. Vue.prototype.$cof = cof;
  15. import hosts from "@/request/config";
  16. Vue.prototype.$hosts = hosts;
  17. import { up } from "@/utils/up";
  18. Vue.prototype.$up = up;
  19. import { goto } from '@/utils/myfun.js';
  20. Vue.prototype.goto = goto;
  21. //注册为全局组件 - 通告
  22. import noticeBar from "@/components/noticeBar";
  23. Vue.component('noticeBar', noticeBar);
  24. App.mpType = 'app'
  25. const app = new Vue({
  26. ...App
  27. })
  28. app.$mount()
  29. Array.prototype.indexOf = function (val) {
  30. for (var i = 0; i < this.length; i++) {
  31. if (this[i] == val) return i;
  32. }
  33. return -1;
  34. };
  35. Array.prototype.remove = function (val) {
  36. var index = this.indexOf(val);
  37. if (index > -1) {
  38. this.splice(index, 1);
  39. }
  40. };
  41. Vue.directive('myfocus', {
  42. inserted: (el, binding) => {
  43. if (binding.value == true || binding.value == undefined) {
  44. el.focus()
  45. }
  46. }
  47. });