main.js 843 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import App from './App'
  2. // #ifndef VUE3
  3. import Vue from 'vue'
  4. import time from '@/commit/item.js';
  5. import store from '@/store/index.js'
  6. import uView from '@/uni_modules/uview-ui';
  7. import Vconsole from "vconsole"
  8. // import VConsole from 'vconsole'
  9. const vConsole = new Vconsole();
  10. // console.log('vConsole is running!');
  11. // main.js,注意要在use方法之后执行
  12. import uViews from 'uview-ui'
  13. Vue.use(uViews)
  14. // 如此配置即可
  15. uni.$u.config.unit = 'rpx'
  16. Vue.config.productionTip = false
  17. Vue.prototype.$time = time
  18. Vue.prototype.$store = store
  19. App.mpType = 'app'
  20. Vue.use(uView);
  21. const app = new Vue({
  22. ...App,
  23. store
  24. })
  25. app.$mount()
  26. // #endif
  27. // #ifdef VUE3
  28. import { createSSRApp } from 'vue'
  29. export function createApp() {
  30. const app = createSSRApp(App)
  31. return {
  32. app
  33. }
  34. }
  35. // #endif