main.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import { createApp } from 'vue';
  2. // global css
  3. import 'virtual:uno.css';
  4. import 'element-plus/theme-chalk/dark/css-vars.css';
  5. import '@/assets/styles/index.scss';
  6. // Element Plus 中文语言包
  7. import zhCn from 'element-plus/dist/locale/zh-cn.mjs';
  8. import ElementPlus from 'element-plus';
  9. // App、router、store
  10. import App from './App.vue';
  11. import store from './store';
  12. import router from './router';
  13. // 自定义指令
  14. import directive from './directive';
  15. // 注册插件
  16. import plugins from './plugins/index'; // plugins
  17. // 高亮组件
  18. // import 'highlight.js/styles/a11y-light.css';
  19. import 'highlight.js/styles/atom-one-dark.css';
  20. import 'highlight.js/lib/common';
  21. import HighLight from '@highlightjs/vue-plugin';
  22. // svg图标
  23. import 'virtual:svg-icons-register';
  24. import ElementIcons from '@/plugins/svgicon';
  25. // permission control
  26. import './permission';
  27. // 开发者工具保护
  28. import { initDevToolsProtection } from '@/utils/devtools-protection';
  29. // vxeTable
  30. import VXETable from 'vxe-table';
  31. import 'vxe-table/lib/style.css';
  32. VXETable.setConfig({
  33. zIndex: 999999
  34. });
  35. // 修改 el-dialog 默认点击遮照为不关闭
  36. import { ElDialog } from 'element-plus';
  37. ElDialog.props.closeOnClickModal.default = false;
  38. const app = createApp(App);
  39. // 注册 Element Plus 并配置中文语言
  40. app.use(ElementPlus, {
  41. locale: zhCn
  42. });
  43. app.use(HighLight);
  44. app.use(ElementIcons);
  45. app.use(router);
  46. app.use(store);
  47. app.use(VXETable);
  48. app.use(plugins);
  49. // 自定义指令
  50. directive(app);
  51. app.mount('#app');
  52. // 初始化开发者工具保护(仅生产环境)
  53. // initDevToolsProtection();