main.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // #ifndef VUE3
  2. import Vue from 'vue'
  3. import App from './App'
  4. import navBar from '@/components/navBar/index.vue'
  5. import tabBar from '@/components/tabBar/index.vue'
  6. import loadingPage from '@/components/loadingPage/index.vue'
  7. Vue.component('navBar', navBar)
  8. Vue.component('tabBar', tabBar)
  9. Vue.component('loadingPage', loadingPage)
  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. Vue.prototype.$picBase = 'https://hb.swdz.com/static/other/'
  15. Vue.prototype.$picBase2 = 'https://hb.swdz.com/static/other/'
  16. Vue.prototype.$ossBaseUrl = 'https://zhengda.oss-cn-chengdu.aliyuncs.com/'
  17. Vue.prototype.$appId = 'wxa7481605ea99a9a0'
  18. Vue.prototype.$shareType = 0
  19. import uploadUrl from '@/common/config.js'
  20. // Vue.prototype.$picUrl = uploadUrl.picUrl
  21. // Vue.prototype.$picBase = uploadUrl.picBase
  22. // import store from "@/store";
  23. // let vuexStore = require('@/store/$t.mixin.js');
  24. // Vue.mixin(vuexStore);
  25. // 常见功能函数封装
  26. Vue.prototype.$toast = (title, icon = "none", duration = 1500) => {
  27. uni.showToast({
  28. title,
  29. icon,
  30. duration
  31. })
  32. }
  33. // 引入请求封装
  34. require('./utils/request/index')(app)
  35. Vue.config.productionTip = false
  36. App.mpType = 'app'
  37. const app = new Vue({
  38. ...App
  39. })
  40. app.$mount()
  41. // #endif
  42. // #ifdef VUE3
  43. import {
  44. createSSRApp
  45. } from 'vue'
  46. import App from './App.vue'
  47. export function createApp() {
  48. const app = createSSRApp(App)
  49. return {
  50. app
  51. }
  52. }
  53. // #endif