main.js 653 B

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