main.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. import oaSteps from "@/components/oa-steps/index"
  23. import oaChatSSEClient from "@/components/oa-chatSSEClient/index"
  24. // import hideHead from "./utils/hideHead.js";
  25. export function createApp() {
  26. const app = createSSRApp(App);
  27. // app.mixin(hideHead);// 隐藏头部双重标题
  28. //挂载全局组件
  29. app.component('oa-calendar', oaCalendar)
  30. app.component('oa-tabbar', oaTabbar)
  31. app.component('oa-timeLine', oaTimeLine)
  32. app.component('oa-timeLine-item', oaTimeLineItem)
  33. app.component('oa-upload', oaUpload)
  34. app.component('oa-scroll', oaScroll)
  35. app.component('oa-touch', oaTouch)
  36. app.component('oa-dropdown', oaDropdown)
  37. app.component('oa-upgrade', oaUpgrade)
  38. app.component('oa-transForm', oaTransForm)
  39. app.component('oa-ttsAudio', oaTtsAudio)
  40. app.component('oa-weather', oaWeather)
  41. app.component('oa-steps', oaSteps)
  42. app.component('oa-chatSSEClient', oaChatSSEClient)
  43. // 挂载全局json导出
  44. app.component("downloadExcel", JsonExcel);
  45. // 添加全局变量
  46. app.provide("$store", store);
  47. app.config.globalProperties.$store = store;
  48. app
  49. .use(uviewPlus)
  50. .use(store)
  51. .use(plugins);
  52. return {
  53. app,
  54. };
  55. }