main.js 700 B

12345678910111213141516171819202122232425262728293031323334
  1. import App from './App'
  2. //导入全局api
  3. import api from '@/https/api.js';
  4. Vue.prototype.$api = api;
  5. import uView from '@/uni_modules/uview-ui'
  6. Vue.use(uView)
  7. //全局使用dayjs
  8. import dayjs from "dayjs";
  9. Vue.prototype.dayjs = dayjs;
  10. import empty from "@/components/empty.vue"
  11. import navigation from "@/components/navigation.vue"
  12. Vue.component('empty', empty)
  13. Vue.component('navigation', navigation)
  14. // #ifndef VUE3
  15. import Vue from 'vue'
  16. Vue.config.productionTip = false
  17. App.mpType = 'app'
  18. const app = new Vue({
  19. ...App
  20. })
  21. app.$mount()
  22. // #endif
  23. // #ifdef VUE3
  24. import { createSSRApp } from 'vue'
  25. export function createApp() {
  26. const app = createSSRApp(App)
  27. return {
  28. app
  29. }
  30. }
  31. // #endif