main.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import { createApp } from 'vue';
  2. import pinia from '/@/stores/index';
  3. import App from './App.vue';
  4. import router from './router';
  5. import { directive } from '/@/directive';
  6. import { i18n } from '/@/i18n';
  7. import other from '/@/utils/other';
  8. import ElementPlus from 'element-plus';
  9. import '/@/theme/tailwind.css';
  10. import 'element-plus/dist/index.css';
  11. import '/@/theme/index.scss';
  12. import { ElementIcons, Pagination, RightToolbar, DictTag, UploadExcel, UploadFile, UploadImg, Editor, Tip, DelWrap } from '/@/components/index';
  13. import { parseTime, parseDate, dateTimeStr, dateStr, timeStr } from '/@/utils/formatTime';
  14. // 布局工具
  15. import { Splitpanes, Pane } from 'splitpanes';
  16. import 'splitpanes/dist/splitpanes.css';
  17. const app = createApp(App);
  18. // 导入通用自定义组件
  19. app.component('DictTag', DictTag);
  20. app.component('Pagination', Pagination);
  21. app.component('RightToolbar', RightToolbar);
  22. app.component('uploadExcel', UploadExcel);
  23. app.component('UploadFile', UploadFile);
  24. app.component('UploadImg', UploadImg);
  25. app.component('Editor', Editor);
  26. app.component('Tip', Tip);
  27. app.component('DelWrap', DelWrap);
  28. // 导入布局插件
  29. app.component('Splitpanes', Splitpanes);
  30. app.component('Pane', Pane);
  31. // 全局方法挂载
  32. app.config.globalProperties.parseTime = parseTime;
  33. app.config.globalProperties.parseDate = parseDate;
  34. app.config.globalProperties.dateTimeStr = dateTimeStr;
  35. app.config.globalProperties.dateStr = dateStr;
  36. app.config.globalProperties.timeStr = timeStr;
  37. app.config.globalProperties.baseURL = import.meta.env.VITE_API_URL;
  38. directive(app);
  39. other.elSvg(app);
  40. app
  41. .use(pinia) // pinia 存储
  42. .use(router) // 路由
  43. .use(ElementPlus) // ElementPlus 全局引入
  44. .use(ElementIcons) // elementIcons 图标全局引入
  45. .use(i18n) // 国际化
  46. .mount('#app');