大语言模型
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.js 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import { createApp } from 'vue'
  2. import Cookies from 'js-cookie'
  3. import ElementPlus from 'element-plus'
  4. import 'element-plus/dist/index.css'
  5. import 'element-plus/theme-chalk/dark/css-vars.css'
  6. import locale from 'element-plus/es/locale/lang/zh-cn'
  7. import '@/assets/styles/index.scss' // global css
  8. import App from './App'
  9. import store from './store'
  10. import router from './router'
  11. import directive from './directive' // directive
  12. // 注册指令
  13. import plugins from './plugins' // plugins
  14. import { download } from '@/utils/request'
  15. // svg图标
  16. import 'virtual:svg-icons-register'
  17. import SvgIcon from '@/components/SvgIcon'
  18. import elementIcons from '@/components/SvgIcon/svgicon'
  19. import './permission' // permission control
  20. import { useDict } from '@/utils/dict'
  21. import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'
  22. // 分页组件
  23. import Pagination from '@/components/Pagination'
  24. // 自定义表格工具组件
  25. import RightToolbar from '@/components/RightToolbar'
  26. // 富文本组件
  27. import Editor from "@/components/Editor"
  28. // 文件上传组件
  29. import FileUpload from "@/components/FileUpload"
  30. // 图片上传组件
  31. import ImageUpload from "@/components/ImageUpload"
  32. // 图片预览组件
  33. import ImagePreview from "@/components/ImagePreview"
  34. // 字典标签组件
  35. import DictTag from '@/components/DictTag'
  36. const app = createApp(App)
  37. // 全局方法挂载
  38. app.config.globalProperties.useDict = useDict
  39. app.config.globalProperties.download = download
  40. app.config.globalProperties.parseTime = parseTime
  41. app.config.globalProperties.resetForm = resetForm
  42. app.config.globalProperties.handleTree = handleTree
  43. app.config.globalProperties.addDateRange = addDateRange
  44. app.config.globalProperties.selectDictLabel = selectDictLabel
  45. app.config.globalProperties.selectDictLabels = selectDictLabels
  46. // 全局组件挂载
  47. app.component('DictTag', DictTag)
  48. app.component('Pagination', Pagination)
  49. app.component('FileUpload', FileUpload)
  50. app.component('ImageUpload', ImageUpload)
  51. app.component('ImagePreview', ImagePreview)
  52. app.component('RightToolbar', RightToolbar)
  53. app.component('Editor', Editor)
  54. app.use(router)
  55. app.use(store)
  56. app.use(plugins)
  57. app.use(elementIcons)
  58. app.component('svg-icon', SvgIcon)
  59. directive(app)
  60. // 使用element-plus 并且设置全局的大小
  61. app.use(ElementPlus, {
  62. locale: locale,
  63. // 支持 large、default、small
  64. size: Cookies.get('size') || 'default'
  65. })
  66. app.mount('#app')