main.js 944 B

12345678910111213141516171819202122232425262728293031
  1. import App from './App'
  2. import request from './common/request';
  3. import emotion from './common/emotion.js';
  4. import * as enums from './common/enums.js';
  5. import * as date from './common/date';
  6. import * as socketApi from './common/wssocket';
  7. import * as messageType from './common/messageType';
  8. import store from './store';
  9. import { createSSRApp } from 'vue'
  10. // #ifdef H5
  11. import * as recorder from './common/recorder-h5';
  12. // #endif
  13. // #ifndef H5
  14. import * as recorder from './common/recorder-app';
  15. // #endif
  16. export function createApp() {
  17. const app = createSSRApp(App)
  18. app.use(store);
  19. app.config.globalProperties.$http = request;
  20. app.config.globalProperties.$wsApi = socketApi;
  21. app.config.globalProperties.$msgType = messageType;
  22. app.config.globalProperties.$emo = emotion;
  23. app.config.globalProperties.$enums = enums;
  24. app.config.globalProperties.$date = date;
  25. app.config.globalProperties.$rc = recorder;
  26. return {
  27. app
  28. }
  29. }