main.js 848 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. // 常见功能函数封装
  13. Vue.prototype.$toast = (title, icon = "none", duration = 1500) => {
  14. uni.showToast({
  15. title,
  16. icon,
  17. duration
  18. })
  19. }
  20. // 引入请求封装
  21. require('./utils/request/index')(app)
  22. Vue.config.productionTip = false
  23. App.mpType = 'app'
  24. const app = new Vue({
  25. ...App
  26. })
  27. app.$mount()
  28. // #endif
  29. // #ifdef VUE3
  30. import {
  31. createSSRApp
  32. } from 'vue'
  33. import App from './App.vue'
  34. export function createApp() {
  35. const app = createSSRApp(App)
  36. return {
  37. app
  38. }
  39. }
  40. // #endif