main.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import Vue from 'vue'
  2. import App from './App'
  3. // #ifdef H5
  4. import wx from 'weixin-jsapi'
  5. Vue.prototype.wx = wx //声明扫码
  6. Vue.prototype.audios = [] //待播放的语音集合
  7. // #endif
  8. // #ifdef APP-PLUS
  9. Vue.prototype.$ws = null//websocket
  10. // #endif
  11. Vue.config.productionTip = false
  12. Date.prototype.Format = function (fmt) {
  13. var o = {
  14. "M+": this.getMonth() + 1, //月份
  15. "d+": this.getDate(), //日
  16. "h+": this.getHours(), //小时
  17. "m+": this.getMinutes(), //分
  18. "s+": this.getSeconds(), //秒
  19. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  20. S: this.getMilliseconds(), //毫秒
  21. };
  22. if (/(y+)/.test(fmt))
  23. fmt = fmt.replace(
  24. RegExp.$1,
  25. (this.getFullYear() + "").substr(4 - RegExp.$1.length)
  26. );
  27. for (var k in o)
  28. if (new RegExp("(" + k + ")").test(fmt))
  29. fmt = fmt.replace(
  30. RegExp.$1,
  31. RegExp.$1.length == 1
  32. ? o[k]
  33. : ("00" + o[k]).substr(("" + o[k]).length)
  34. );
  35. return fmt;
  36. };
  37. App.mpType = 'app'
  38. const app = new Vue({
  39. ...App
  40. })
  41. app.$mount()