main.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // #ifndef VUE3
  2. import Vue from 'vue'
  3. import App from './App'
  4. import navBar from '@/components/navBar/index.vue'
  5. // import shareAppMessage from './core/shareAppMessage.js';
  6. // Vue.prototype.$shareAppMessage = shareAppMessage; //分享
  7. Vue.component('navBar', navBar)
  8. import popup from '@/components/popup/index.vue'
  9. Vue.component('dpopup', popup)
  10. import uView from '@/uni_modules/uview-ui'
  11. Vue.use(uView)
  12. import store from 'store/index.js'
  13. Vue.prototype.$store = store
  14. import uploadUrl from '@/common/config.js'
  15. Vue.prototype.$picUrl = uploadUrl.picUrl
  16. Vue.prototype.$picBase = uploadUrl.picBase
  17. // 常见功能函数封装
  18. Vue.prototype.$toast = (title, icon = "none", duration = 1500) => {
  19. uni.showToast({
  20. title,
  21. icon,
  22. duration
  23. })
  24. }
  25. // 引入请求封装
  26. require('./utils/request/index')(app)
  27. Vue.config.productionTip = false
  28. App.mpType = 'app'
  29. const app = new Vue({
  30. ...App
  31. })
  32. app.$mount()
  33. // #endif
  34. // #ifdef VUE3
  35. import {
  36. createSSRApp
  37. } from 'vue'
  38. import App from './App.vue'
  39. export function createApp() {
  40. const app = createSSRApp(App)
  41. return {
  42. app
  43. }
  44. }
  45. // #endif