main.js 976 B

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