main.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import Vue from 'vue'
  2. import App from './App'
  3. Vue.config.productionTip = false
  4. import uView from 'uview-ui'
  5. Vue.use(uView)
  6. // uni.$u.config.unit = 'rpx'
  7. import utils from './utils/common.js'
  8. Vue.prototype.utils = utils;
  9. import {
  10. setData,
  11. } from './utils/common.js'
  12. // vuex
  13. import store from '@/store/index.js'
  14. Vue.prototype.setData = setData;
  15. App.mpType = 'app'
  16. const app = new Vue({
  17. ...App,
  18. store
  19. })
  20. app.$mount()
  21. // #ifdef VUE3
  22. import { createSSRApp } from 'vue'
  23. export function createApp() {
  24. const app = createSSRApp(App)
  25. app.use(uviewPlus)
  26. app.config.globalProperties.$isLogin = isLogin
  27. app.config.globalProperties.$isEmpty = isEmpty
  28. app.config.globalProperties.$parsePhone = parsePhone
  29. app.config.globalProperties.$showLoginPage = showLoginPage
  30. app.config.globalProperties.$getRegistrationID = getRegistrationID
  31. app.config.globalProperties.$navBack = navBack
  32. app.config.globalProperties.$navTo = navTo
  33. app.config.globalProperties.$qconfig = qconfig
  34. app.config.globalProperties.$getAge = getAge
  35. app.config.globalProperties.$parseIdCard = parseIdCard
  36. app.config.globalProperties.$getDictLabelName = getDictLabelName
  37. app.config.globalProperties.$parseText = parseText
  38. app.config.globalProperties.$logout = logout,
  39. app.config.globalProperties.$getUserInfo = getUserInfo,
  40. app.config.globalProperties.$dateFormatStr = dateFormatStr,
  41. app.config.globalProperties.$registerIdCode = registerIdCode,
  42. app.config.globalProperties.$formatSeconds = formatSeconds,
  43. app.config.globalProperties.$formatDate = formatDate,
  44. app.config.globalProperties.$parseIDCardInfo = parseIDCardInfo
  45. app.config.globalProperties.$timeFormat = timeFormat;
  46. app.config.globalProperties.$formatHour = formatHour;
  47. return {
  48. app
  49. }
  50. }
  51. // #endif