main.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import Vue from 'vue'
  2. import App from './App'
  3. import cuCustom from './colorui/components/cu-custom.vue'
  4. Vue.component('cu-custom',cuCustom)
  5. import sunUiPassword from './sunui-password/sunui-password.vue'
  6. Vue.component('sunui-password',sunUiPassword);
  7. Vue.config.productionTip = false
  8. import store from './common/store.js';
  9. App.mpType = 'app'
  10. import Dataprocessing from './common/dataprocessing.js';
  11. Vue.prototype.dataprocessing=Dataprocessing;
  12. import Common from './common/common.js';
  13. Vue.prototype.common = Common;
  14. Vue.prototype.getTimeFormat = function(){
  15. Date.prototype.Format = function(fmt) {
  16. var o = {
  17. 'y+': this.getYear() + 1, //年
  18. 'M+': this.getMonth() + 1, //月份
  19. 'd+': this.getDate(), //日
  20. 'h+': this.getHours(), //小时
  21. 'm+': this.getMinutes(), //分
  22. 's+': this.getSeconds(), //秒
  23. 'q+': Math.floor((this.getMonth() + 3) / 3), //季度
  24. S: this.getMilliseconds() //毫秒
  25. };
  26. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length));
  27. for (var k in o)
  28. if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[
  29. k]).substr(('' + o[k]).length));
  30. return fmt;
  31. };
  32. }
  33. const app = new Vue({
  34. store,
  35. ...App
  36. })
  37. app.$mount()