main.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // #ifndef VUE3
  2. import Vue from 'vue'
  3. import App from './App'
  4. import './composition-api'
  5. import { navigateTo, redirectTo, selectDictLabel } from '@/utils/utils.js'
  6. import { fileBasUrl } from '@/api/config.js'
  7. import { fileUrl } from '@/utils/commonConfig.js'
  8. Vue.prototype.$navigateTo = navigateTo
  9. Vue.prototype.$redirectTo = redirectTo
  10. // 媒体文件地址
  11. Vue.prototype.$fileUrl = fileUrl
  12. Vue.prototype.$selectDictLabel = selectDictLabel
  13. Vue.config.productionTip = false
  14. App.mpType = 'app'
  15. const app = new Vue({
  16. ...App,
  17. })
  18. app.$mount()
  19. // #endif
  20. // 时间过滤
  21. Date.prototype.Format = function (fmt) {
  22. //author: meizz
  23. var 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 (var k in o)
  34. if (new RegExp('(' + k + ')').test(fmt))
  35. fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length))
  36. return fmt
  37. }
  38. // #ifdef VUE3
  39. import { createSSRApp } from 'vue'
  40. import App from './App.vue'
  41. export function createApp() {
  42. const app = createSSRApp(App)
  43. return {
  44. app,
  45. }
  46. }
  47. // #endif