main.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import App from './App'
  2. import store from './store'
  3. import dd from '@/static/dd.js'
  4. import moment from "moment"
  5. // #ifndef VUE3
  6. import Vue from 'vue'
  7. import Http from './common/js/http.js'
  8. // main.js
  9. import uView from "uview-ui"
  10. Vue.use(uView)
  11. Vue.prototype.$api = Http;
  12. Vue.config.productionTip = false
  13. Vue.prototype.$store = store
  14. Vue.prototype.$backgroundAudioData = {
  15. playing: false,
  16. playTime: 0,
  17. formatedPlayTime: '00:00:00'
  18. }
  19. Vue.prototype.$dd = dd
  20. Vue.prototype.$moment=moment
  21. window.wx = {}
  22. App.mpType = 'app'
  23. const app = new Vue({
  24. store,
  25. ...App
  26. })
  27. app.$mount()
  28. // #endif
  29. // window.addEventListener("popstate", function(e) {
  30. // // self.location.reload();
  31. // if (event.persisted) {} else {
  32. // location.reload();
  33. // }
  34. // }, false);
  35. // #ifdef VUE3
  36. import {
  37. createSSRApp
  38. } from 'vue'
  39. export function createApp() {
  40. const app = createSSRApp(App)
  41. app.use(store)
  42. app.config.globalProperties.$adpid = "1111111111"
  43. app.config.globalProperties.$backgroundAudioData = {
  44. playing: false,
  45. playTime: 0,
  46. formatedPlayTime: '00:00:00'
  47. }
  48. return {
  49. app
  50. }
  51. }
  52. // #endif