main.js 960 B

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