main.js 857 B

123456789101112131415161718192021222324252627282930313233343536
  1. import App from './App'
  2. // #ifndef VUE3
  3. import Vue from 'vue'
  4. Vue.config.productionTip = false
  5. App.mpType = 'app'
  6. const app = new Vue({
  7. ...App
  8. })
  9. app.$mount()
  10. // #endif
  11. // #ifdef VUE3
  12. import { createSSRApp } from 'vue'
  13. export function createApp() {
  14. const app = createSSRApp(App)
  15. return {
  16. app
  17. }
  18. }
  19. // #endif
  20. Vue.filter('globalTime',function (value) {
  21. if (value) {
  22. const time = new Date(value * 1000);
  23. const y = time.getFullYear();
  24. const m = (time.getMonth() + 1) < 10 ? '0' + (time.getMonth() + 1) : (time.getMonth() + 1);
  25. const d = time.getDate() < 10 ? '0' + time.getDate(): time.getDate();
  26. // const h = time.getHours()
  27. // const mm = time.getMinutes();
  28. // const s = time.getSeconds();
  29. return y + '-' + m + '-' + d
  30. } else {
  31. return ''
  32. }
  33. });