main.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { createApp } from 'vue';
  2. import App from './App.vue';
  3. import router from './router';
  4. import { store, key } from './store';
  5. import { directive } from '/@/utils/directive';
  6. import { i18n } from '/@/i18n/index';
  7. import other from '/@/utils/other';
  8. import ElementPlus from 'element-plus';
  9. import 'element-plus/dist/index.css';
  10. import '/@/theme/index.scss';
  11. import mitt from 'mitt';
  12. import VueGridLayout from 'vue-grid-layout';
  13. import {getUpFileUrl, handleTree, selectDictLabel} from "/@/utils/common";
  14. import {useDict} from "/@/api/common/dict/data";
  15. // 分页组件
  16. import pagination from '/@/components/pagination/index.vue'
  17. import 'amis/sdk/sdk.js';
  18. import 'amis/lib/themes/default.css';
  19. const app = createApp(App);
  20. directive(app);
  21. other.elSvg(app);
  22. app.component('pagination', pagination)
  23. app.use(router)
  24. .use(store, key)
  25. .use(ElementPlus, { i18n: i18n.global.t })
  26. .use(i18n)
  27. .use(VueGridLayout)
  28. .mount('#app');
  29. // 全局挂载
  30. app.config.globalProperties.getUpFileUrl=getUpFileUrl
  31. app.config.globalProperties.handleTree=handleTree
  32. app.config.globalProperties.useDict=useDict
  33. app.config.globalProperties.selectDictLabel=selectDictLabel
  34. app.config.globalProperties.mittBus = mitt();