main.js 837 B

1234567891011121314151617181920212223242526272829
  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 store from './store';
  8. import { createSSRApp } from 'vue'
  9. // #ifdef H5
  10. import * as recorder from './common/recorder-h5';
  11. // #endif
  12. // #ifndef H5
  13. import * as recorder from './common/recorder-app';
  14. // #endif
  15. export function createApp() {
  16. const app = createSSRApp(App)
  17. app.use(store);
  18. app.config.globalProperties.$http = request;
  19. app.config.globalProperties.$wsApi = socketApi;
  20. app.config.globalProperties.$emo = emotion;
  21. app.config.globalProperties.$enums = enums;
  22. app.config.globalProperties.$date = date;
  23. app.config.globalProperties.$rc = recorder;
  24. return {
  25. app
  26. }
  27. }