main.js 1002 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import App from './App'
  2. import * as http from './utils/http' // http请求接口
  3. import * as utils from './utils/utils' // 工具文件
  4. import storage from 'utils/storage' // 缓存文件
  5. import config from '@/config' // 配置
  6. // import lodash
  7. Vue.prototype.$storage = storage
  8. Vue.prototype.$http = http
  9. Vue.prototype.$config = config
  10. Vue.prototype.$utils = utils
  11. import MD5 from 'js-md5'
  12. Vue.prototype.$md5 = MD5
  13. //audio
  14. // Vue.prototype.$scanAudio = function(){
  15. // let muisc = null;
  16. // muisc = uni.createInnerAudioContext();
  17. // muisc.src = "../../static/voice.mp3";
  18. // muisc.play();
  19. // muisc.onEnd(() => {
  20. // muisc = null
  21. // })
  22. // }
  23. Vue.prototype.$scanAudio = uni.createInnerAudioContext();
  24. // #ifndef VUE3
  25. import Vue from 'vue'
  26. // ********** devapi *********
  27. App.mpType = 'app'
  28. const app = new Vue({
  29. ...App
  30. })
  31. app.$mount()
  32. // #endif
  33. // #ifdef VUE3
  34. import { createSSRApp } from 'vue'
  35. export function createApp() {
  36. const app = createSSRApp(App)
  37. return {
  38. app
  39. }
  40. }
  41. // #endif