main.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. import jtecharts from './components/jt-echarts/jt-echarts.vue'
  29. // 引入jt3dSDK
  30. import '/public/jt3dSDK/index.css';
  31. import * as jt3dSDK from '/public/jt3dSDK/jt3d.es.js';
  32. import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
  33. // import 'amfe-flexible';//rem适配
  34. import Print from 'vue3-print-nb'; //引入打印模块
  35. // 创建 Pinia 实例
  36. const pinia = createPinia();
  37. pinia.use(piniaPluginPersistedstate);
  38. // 创建实例
  39. let app = createApp(App);
  40. for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  41. app.component(key, component)
  42. }
  43. //挂载到vue根实例上
  44. app.config.globalProperties.$http = http
  45. app.config.globalProperties.$md5 = md5
  46. app.config.globalProperties.jt3dSDK = jt3dSDK
  47. app.directive('drag', drag)
  48. app.component("jt-popup",jtpopup)
  49. app.component("jt-popup2",jtpopup2)
  50. app.component("jt-popup3",jtpopup3)
  51. app.component("jt-popup-if",jtpopupif)
  52. app.component("jt-drawer",jtdrawer)
  53. app.component("jt-charts",jtcharts)
  54. app.component("jt-echarts",jtecharts)
  55. // app.use(pinia) 在store使用
  56. app.use(router);
  57. app.use(ElementPlus);
  58. app.use(Print);
  59. app.mount('#app');