main.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import { createSSRApp } from "vue";
  2. import App from "./App";
  3. import store from "./store"; // store
  4. import plugins from "./plugins"; // plugins
  5. import "./permission"; // permission
  6. // 引入json导出组件
  7. import JsonExcel from "vue-json-excel";
  8. // 引入UI组件
  9. import uviewPlus from "@/uni_modules/uview-plus";
  10. import oaCalendar from "@/components/oa-calendar/uni-calendar";
  11. import oaTabbar from "@/components/oa-tabbar/index";
  12. import oaTimeLine from "@/components/oa-timeLine/index"
  13. import oaTimeLineItem from "@/components/oa-timeLine-item/index"
  14. import oaUpload from "@/components/oa-upload/index"
  15. import oaScroll from "@/components/oa-scroll/index"
  16. import oaTouch from "@/components/oa-touch/index"
  17. import oaDropdown from "@/components/oa-dropdown/index"
  18. import oaUpgrade from "@/components/oa-upgrade/index"
  19. import oaTransForm from "@/components/oa-transForm/index"
  20. import oaTtsAudio from "@/components/oa-ttsAudio/index"
  21. import oaWeather from "@/components/oa-weather/index"
  22. export function createApp() {
  23. const app = createSSRApp(App);
  24. //挂载全局组件
  25. app.component('oa-calendar', oaCalendar)
  26. app.component('oa-tabbar', oaTabbar)
  27. app.component('oa-timeLine', oaTimeLine)
  28. app.component('oa-timeLine-item', oaTimeLineItem)
  29. app.component('oa-upload', oaUpload)
  30. app.component('oa-scroll', oaScroll)
  31. app.component('oa-touch', oaTouch)
  32. app.component('oa-dropdown', oaDropdown)
  33. app.component('oa-upgrade', oaUpgrade)
  34. app.component('oa-transForm', oaTransForm)
  35. app.component('oa-ttsAudio', oaTtsAudio)
  36. app.component('oa-weather', oaWeather)
  37. // 挂载全局json导出
  38. app.component("downloadExcel", JsonExcel);
  39. // 添加全局变量
  40. app.provide("$store", store);
  41. app.config.globalProperties.$store = store;
  42. app
  43. .use(uviewPlus)
  44. .use(store)
  45. .use(plugins);
  46. return {
  47. app,
  48. };
  49. }