main.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // #ifndef VUE3
  2. import Vue from 'vue'
  3. import App from './App'
  4. import './composition-api'
  5. import {
  6. navigateTo,
  7. redirectTo,
  8. selectDictLabel
  9. } from '@/utils/utils.js'
  10. import {
  11. fileBasUrl
  12. } from '@/api/config.js'
  13. import {
  14. fileUrl
  15. } from "@/utils/commonConfig.js"
  16. Vue.prototype.$navigateTo = navigateTo;
  17. Vue.prototype.$redirectTo = redirectTo;
  18. // 媒体文件地址
  19. Vue.prototype.$fileUrl = fileUrl;
  20. Vue.prototype.$selectDictLabel = selectDictLabel;
  21. Vue.config.productionTip = false
  22. App.mpType = 'app'
  23. const app = new Vue({
  24. ...App
  25. })
  26. app.$mount()
  27. // #endif
  28. // 时间过滤
  29. Date.prototype.Format = function (fmt) { //author: meizz
  30. var o = {
  31. "M+": this.getMonth() + 1, //月份
  32. "d+": this.getDate(), //日
  33. "h+": this.getHours(), //小时
  34. "m+": this.getMinutes(), //分
  35. "s+": this.getSeconds(), //秒
  36. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  37. "S": this.getMilliseconds() //毫秒
  38. };
  39. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  40. for (var k in o)
  41. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  42. return fmt;
  43. }
  44. // #ifdef VUE3
  45. import { createSSRApp } from 'vue'
  46. import App from './App.vue'
  47. export function createApp() {
  48. const app = createSSRApp(App)
  49. return {
  50. app
  51. }
  52. }
  53. // #endif