main.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import { createApp } from 'vue'
  2. import App from './App.vue'
  3. import router from './router'
  4. import store from './store'
  5. // ElementPlus
  6. import ElementPlus from 'element-plus'
  7. import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
  8. import 'element-plus/dist/index.css'
  9. import '@/style/element-variables.scss'
  10. import * as ElementPlusIconsVue from '@element-plus/icons-vue'
  11. //iconpark
  12. import {install} from '@icon-park/vue-next/es/all';
  13. // markdown
  14. import VMdPreview from '@kangc/v-md-editor/lib/preview';
  15. import '@kangc/v-md-editor/lib/style/preview.css';
  16. import mdTheme from '@kangc/v-md-editor/lib/theme/github.js';
  17. import '@kangc/v-md-editor/lib/theme/style/github.css';
  18. import hljs from 'highlight.js';
  19. VMdPreview.use(mdTheme, {
  20. Hljs: hljs,
  21. });
  22. const app = createApp(App);
  23. app.use(store);
  24. app.use(router);
  25. app.use(ElementPlus, {
  26. locale: zhCn,
  27. });
  28. app.use(VMdPreview);
  29. // element-plus icon, 以ElIcon开头,例如ElIconEdit
  30. for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  31. app.component('ElIcon' + key, component)
  32. }
  33. // iconpark, 以IconPark开头, 例如IconPark-people
  34. install(app, 'IconPark')
  35. //echarts
  36. import * as echarts from 'echarts'
  37. app.config.globalProperties.$echarts = echarts;
  38. // 全局方法
  39. import util from '@/utils/index'
  40. app.config.globalProperties.$util = util
  41. // 常量
  42. import constant from '@/utils/constant'
  43. app.config.globalProperties.$constant = constant
  44. app.mount('#app');
  45. export default app