main.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import App from './App'
  2. // #ifndef VUE3
  3. import Vue from 'vue'
  4. import uView from '@/uni_modules/uview-ui'
  5. import store from './store/index'
  6. Vue.config.productionTip = false
  7. App.mpType = 'app'
  8. Date.prototype.format = function(fmt) {
  9. var o = {
  10. "M+" : this.getMonth()+1, //月份
  11. "d+" : this.getDate(), //日
  12. "h+" : this.getHours(), //小时
  13. "m+" : this.getMinutes(), //分
  14. "s+" : this.getSeconds(), //秒
  15. "q+" : Math.floor((this.getMonth()+3)/3), //季度
  16. "S" : this.getMilliseconds() //毫秒
  17. };
  18. if(/(y+)/.test(fmt)) {
  19. fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
  20. }
  21. for(var k in o) {
  22. if(new RegExp("("+ k +")").test(fmt)){
  23. fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
  24. }
  25. }
  26. return fmt;
  27. }
  28. const app = new Vue({
  29. store,
  30. ...App
  31. })
  32. app.$mount()
  33. Vue.use(uView);
  34. // #endif
  35. // #ifdef VUE3
  36. import { createSSRApp } from 'vue'
  37. export function createApp() {
  38. const app = createSSRApp(App)
  39. return {
  40. app
  41. }
  42. }
  43. // #endif