main.js 623 B

123456789101112131415161718192021222324252627282930
  1. import Vue from 'vue'
  2. import App from './App'
  3. import uView from "uview-ui"
  4. Vue.use(uView)
  5. import {myRequest} from './util/api.js'
  6. Vue.prototype.$myRequest=myRequest
  7. Vue.config.productionTip = false
  8. App.mpType = 'app'
  9. Vue.filter('timeFormat',function(time){
  10. function fun(a){
  11. return String(a).length==1?'0'+a: a
  12. }
  13. let date= new Date(time*1000)
  14. let y=date.getFullYear()
  15. let m=date.getMonth()+1
  16. let d=date.getDate()
  17. let h=date.getHours()
  18. let min=date.getMinutes()
  19. let sec=date.getSeconds()
  20. return `${y}-${fun(m)}-${fun(d)} ${fun(h)}:${fun(min)}:${fun(sec)}`
  21. })
  22. const app = new Vue({
  23. ...App
  24. })
  25. app.$mount()