main.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 uView from '@/uni_modules/uview-ui'
  7. Vue.use(uView)
  8. import navBar from '@/components/navBar/index.vue'
  9. Vue.component('navBar', navBar)
  10. import store from 'store/index.js'
  11. Vue.prototype.$store = store
  12. // 常见功能函数封装
  13. Vue.prototype.$toast = (title, icon = "none", duration = 1500) => {
  14. uni.showToast({
  15. title,
  16. icon,
  17. duration
  18. })
  19. }
  20. // console.log('uploadUrl----', uploadUrl);
  21. import uploadUrl from '@/common/config.js'
  22. Vue.prototype.$picUrl = uploadUrl.picUrl
  23. Vue.prototype.$picBase = uploadUrl.picBase
  24. Vue.prototype.$baseUrl = uploadUrl.baseUrl
  25. Vue.prototype.$appId = uploadUrl.appId
  26. Vue.prototype.$shareType = uploadUrl.shareModel
  27. // 常见功能函数封装
  28. Vue.prototype.$toast = (title, icon = "none", duration = 1500) => {
  29. uni.showToast({
  30. title,
  31. icon,
  32. duration
  33. })
  34. }
  35. // 引入请求封装
  36. require('./utils/request/index')(app)
  37. Vue.config.productionTip = false
  38. App.mpType = 'app'
  39. const app = new Vue({
  40. ...App
  41. })
  42. app.$mount()
  43. // #endif
  44. // #ifdef VUE3
  45. import {
  46. createSSRApp
  47. } from 'vue'
  48. import App from './App.vue'
  49. export function createApp() {
  50. const app = createSSRApp(App)
  51. return {
  52. app
  53. }
  54. }
  55. // #endif