main.js 570 B

1234567891011121314151617181920212223242526272829
  1. import App from './App'
  2. // #ifndef VUE3
  3. import Vue from 'vue'
  4. import './uni.promisify.adaptor'
  5. // 将工具函数挂载到原型上面去
  6. import { showToast,loading } from '@/utils/index'
  7. Vue.prototype.$showToast = showToast
  8. Vue.prototype.$loading = loading
  9. // 挂载 Vuex
  10. import store from './store'
  11. Vue.config.productionTip = false
  12. App.mpType = 'app'
  13. const app = new Vue({
  14. ...App,
  15. store,
  16. })
  17. app.$mount()
  18. // #endif
  19. // #ifdef VUE3
  20. import { createSSRApp } from 'vue'
  21. export function createApp() {
  22. const app = createSSRApp(App)
  23. return {
  24. app
  25. }
  26. }
  27. // #endif