main.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import App from './App'
  2. import request from 'common/request.js'
  3. import common from 'common/common.js'
  4. Vue.prototype.$httpBinary = request.httpBinary
  5. Vue.prototype.$http = request.http
  6. Vue.prototype.$request =request
  7. Vue.prototype.$common =common
  8. Vue.config.productionTip = false
  9. import store from './store'
  10. Vue.prototype.$store = store // 定义成全局组件
  11. /* import share from '@/static/js/share.js'
  12. Vue.mixin(share) */
  13. //https://blog.csdn.net/qq_35432904/article/details/106330079 分享
  14. //佳链天下养车小程序账号AppID(小程序ID)wx9ca21d7c8495757e AppSecret(小程序密钥) 73a76c283f4c4a35a13ea8033527059b
  15. //车蓝图 wx693850514180f795
  16. // #ifndef VUE3
  17. import Vue from 'vue'
  18. Vue.config.productionTip = false
  19. App.mpType = 'app'
  20. const app = new Vue({
  21. ...App
  22. })
  23. app.$mount()
  24. // #endif
  25. // #ifdef VUE3
  26. import { createSSRApp } from 'vue'
  27. export function createApp() {
  28. const app = createSSRApp(App)
  29. return {
  30. app
  31. }
  32. }
  33. // #endif
  34. // Vue全局处理undefined和null转为空白字符串
  35. Vue.prototype.$praseStrEmpty = function(str) {
  36. if (typeof str === 'undefined' || str === null) {
  37. return "";
  38. }
  39. return str;
  40. }
  41. // 防止多次点击
  42. Vue.prototype.$noMultipleClicks = common.noMultipleClicks;