main.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import App from './App'
  2. // import audio from "./common/audio.js";
  3. // #ifndef VUE3
  4. import Vue from 'vue'
  5. import './uni.promisify.adaptor'
  6. Vue.config.productionTip = false
  7. // 卡片配置来源 server:服务器获取 local:本地获取
  8. if (process.env.NODE_ENV === 'development') { // 开发版
  9. Vue.prototype.$cardconfigType = "server";
  10. // Vue.prototype.$cardconfigType = "local";
  11. } else {
  12. Vue.prototype.$cardconfigType = "server";
  13. }
  14. // Vue.prototype.$audio = audio;
  15. App.mpType = 'app'
  16. const app = new Vue({
  17. ...App
  18. })
  19. app.$mount()
  20. // #endif
  21. // #ifdef VUE3
  22. import {
  23. createSSRApp
  24. } from 'vue'
  25. export function createApp() {
  26. const app = createSSRApp(App)
  27. // 卡片配置来源 server:服务器获取 local:本地获取
  28. if (process.env.NODE_ENV === 'development') { // 开发版
  29. app.config.globalProperties.$cardconfigType = "server";
  30. // app.config.globalProperties.$cardconfigType = "local";
  31. } else {
  32. app.config.globalProperties.$cardconfigType = "server";
  33. }
  34. // app.config.globalProperties.$audio = audio;
  35. return {
  36. app
  37. }
  38. }
  39. // #endif