main.js 545 B

1234567891011121314151617181920212223242526272829303132
  1. import App from './App'
  2. // #ifndef VUE3
  3. import Vue from 'vue'
  4. import './uni.promisify.adaptor'
  5. Vue.config.productionTip = false
  6. App.mpType = 'app'
  7. const app = new Vue({
  8. ...App
  9. })
  10. app.$mount()
  11. // #endif
  12. uni.$msg = function(title = '数据请求失败', duration = 1500, icon = 'none') {
  13. uni.showToast({
  14. title,
  15. duration,
  16. icon
  17. })
  18. }
  19. // #ifdef VUE3
  20. import {
  21. createSSRApp
  22. } from 'vue';
  23. import { setupStore } from '@/store';
  24. export function createApp() {
  25. const app = createSSRApp(App)
  26. setupStore(app)
  27. return {
  28. app
  29. }
  30. }
  31. // #endif