main.ts 1014 B

1234567891011121314151617181920212223242526272829303132333435
  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 other from '/@/utils/other';
  7. // 引入element
  8. import ElementPlus from 'element-plus';
  9. import 'element-plus/dist/index.css';
  10. import '/@/theme/index.scss';
  11. // 分页组件
  12. import Pagination from '/@/components/Pagination/index.vue';
  13. // 空组件
  14. import Empty from '/@/components/Empty/index.vue';
  15. // 图片预览
  16. import 'viewerjs/dist/viewer.css';
  17. import VueViewer from 'v-viewer';
  18. const app = createApp(App);
  19. // 自定义指令和svg组件
  20. directive(app);
  21. other.elSvg(app);
  22. // app.config.errorHandler = async (err: any, instance: any, info: any) => {
  23. // // 错误日志
  24. // if (appConfig.clientLog) console.log('globalError: ', err, instance, info);
  25. // }
  26. // 全局组件挂载
  27. app.component('Pagination', Pagination)
  28. app.component('Empty', Empty);
  29. app.use(pinia).use(router).use(ElementPlus).use(VueViewer).mount('#app');