main.js 2.1 KB

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