main.js 905 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import App from './App'
  2. // #ifndef VUE3
  3. import Vue from 'vue'
  4. Vue.config.productionTip = false
  5. import request from 'common/request.js'
  6. import common from 'common/common.js'
  7. Vue.prototype.$http = request.http
  8. import store from './store'
  9. Vue.prototype.$store = store // 定义成全局组件
  10. Vue.prototype.$common =common
  11. Vue.prototype.$request =request
  12. App.mpType = 'app'
  13. const app = new Vue({
  14. store, //挂载
  15. ...App
  16. })
  17. app.$mount()
  18. // #endif
  19. // #ifdef VUE3
  20. import { createSSRApp } from 'vue'
  21. export function createApp() {
  22. const app = createSSRApp(App)
  23. return {
  24. app
  25. }
  26. }
  27. // #endif
  28. //ae3737d4d27ffc8dff0c8f53c5e35b16
  29. //秘钥 86abc1611b51fef4ddcc0a42eb4b800e wx43160afedef08c4a
  30. // Vue全局处理undefined和null转为空白字符串
  31. Vue.prototype.$praseStrEmpty = function(str) {
  32. if (typeof str === 'undefined' || str === null) {
  33. return "";
  34. }
  35. return str;
  36. }