main.js 1.3 KB

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