main.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import Vue from 'vue'
  2. import './plugins/axios'
  3. import App from './App.vue'
  4. import router from './router'
  5. import store from './store'
  6. import Vant from 'vant';
  7. import 'vant/lib/index.css';
  8. import querystring from 'querystring';
  9. import './plugins/element.js'
  10. document.title = '永天科技邀请函'
  11. Vue.use(Vant);
  12. Vue.config.productionTip = false
  13. Vue.prototype.$qs = querystring
  14. new Vue({
  15. router,
  16. store,
  17. render: h => h(App)
  18. }).$mount('#app')
  19. // (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
  20. Date.prototype.Format = function(fmt) {
  21. let o = {
  22. 'M+': this.getMonth() + 1, // 月份
  23. 'd+': this.getDate(), // 日
  24. 'h+': this.getHours(), // 小时
  25. 'm+': this.getMinutes(), // 分
  26. 's+': this.getSeconds(), // 秒
  27. 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
  28. 'S': this.getMilliseconds() // 毫秒
  29. };
  30. if (/(y+)/.test(fmt)) { fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)); }
  31. for (let k in o) {
  32. if (new RegExp('(' + k + ')').test(fmt)) { fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))); }
  33. }
  34. return fmt;
  35. };