main.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import {createApp} from 'vue';
  2. import App from './App.vue';
  3. // 全局样式
  4. import './assets/styles/index.scss';
  5. // 引入字体
  6. import './assets/fonts/iconfont/iconfont.css';
  7. import './assets/fonts/AlimamaShuHeiTiBold/Alimama_ShuHeiTi_Bold.css';
  8. import './assets/fonts/DingTalkJinBuTiRegular/DingTalk_JinBuTi_Regular.css';
  9. // 引入路由
  10. import router from './router/index.js';
  11. // 自定义拖拽指令
  12. import {drag} from "./assets/js/directive.js";
  13. import http from './utils/http.js'
  14. // 引入elementUI 样式
  15. import 'element-plus/dist/index.css';
  16. // 全局引入ElementPlus,无需按需引入
  17. import ElementPlus from 'element-plus';
  18. import * as ElementPlusIconsVue from '@element-plus/icons-vue'
  19. import md5 from "js-md5"
  20. import {createPinia} from 'pinia'
  21. //全局弹出框组件
  22. import jtpopup from './components/jt-popup/jt-popup.vue'
  23. import jtpopup2 from './components/jt-popup/jt-popup2.vue'
  24. import jtpopup3 from './components/jt-popup/jt-popup3.vue'
  25. import jtpopupif from './components/jt-popup/jt-popup-if.vue'
  26. import jtdrawer from './components/jt-drawer/drawer.vue'
  27. import jtcharts from './components/jt-charts/charts.vue'
  28. // 引入jt3dSDK
  29. import '/public/jt3dSDK/index.css';
  30. import * as jt3dSDK from '/public/jt3dSDK/jt3d.es.js';
  31. import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
  32. // import 'amfe-flexible';//rem适配
  33. import Print from 'vue3-print-nb'; //引入打印模块
  34. // 创建 Pinia 实例
  35. const pinia = createPinia();
  36. pinia.use(piniaPluginPersistedstate);
  37. // 创建实例
  38. let app = createApp(App);
  39. for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  40. app.component(key, component)
  41. }
  42. //挂载到vue根实例上
  43. app.config.globalProperties.$http = http
  44. app.config.globalProperties.$md5 = md5
  45. app.config.globalProperties.jt3dSDK = jt3dSDK
  46. app.directive('drag', drag)
  47. app.component("jt-popup",jtpopup)
  48. app.component("jt-popup2",jtpopup2)
  49. app.component("jt-popup3",jtpopup3)
  50. app.component("jt-popup-if",jtpopupif)
  51. app.component("jt-drawer",jtdrawer)
  52. app.component("jt-charts",jtcharts)
  53. // app.use(pinia) 在store使用
  54. app.use(router);
  55. app.use(ElementPlus);
  56. app.use(Print);
  57. app.mount('#app');