main.js 1.1 KB

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