main.js 699 B

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