main.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { createApp } from 'vue';
  2. import App from './App.vue';
  3. import router from './router';
  4. import store from './store';
  5. import 'font-awesome/css/font-awesome.min.css';
  6. // 引入 element-ui
  7. import ElementPlus from 'element-plus';
  8. import 'element-plus/lib/theme-chalk/index.css';
  9. import locale from 'element-plus/lib/locale/lang/zh-cn';
  10. // 引入环境配置
  11. import "@modeConfig/modeConfig.js";
  12. import "@/lib/global-import.js";
  13. // 引入请求工具
  14. import axios from "@api/axios";
  15. // 引入基础工具
  16. import basicTool from "@tools/basicTool";
  17. import animated from 'animate.css';
  18. /**
  19. * 对 Date 的扩展,将 Date 转化为指定格式的字符串
  20. * @param {String} fmt 传入一个字符串,根据所传字符串的格式返回转换后特定格式的日期,调用姿势:new Date().formatDate("yyyy-MM-dd hh:mm:ss");
  21. */
  22. Date.prototype.formatDate = function (fmt) {
  23. let o = {
  24. "M+": this.getMonth() + 1, //月份
  25. "d+": this.getDate(), //日
  26. "h+": this.getHours(), //小时
  27. "m+": this.getMinutes(), //分
  28. "s+": this.getSeconds(), //秒
  29. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  30. "S": this.getMilliseconds() //毫秒
  31. };
  32. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  33. for (let k in o)
  34. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  35. return fmt;
  36. }
  37. window.__STATICVUE__ = createApp(App);
  38. window.__STATICVUE__.use(ElementPlus, { locale });
  39. window.__STATICVUE__.use(store);
  40. window.__STATICVUE__.use(router);
  41. window.__STATICVUE__.use(animated);
  42. window.__STATICVUE__.config.globalProperties.API = axios; //全局注册
  43. window.__STATICVUE__.config.globalProperties.BASE = basicTool; //全局注册
  44. window.__STATICVUE__.mount('#app');