main.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import { createApp } from 'vue'
  2. import './style.css'
  3. import App from './App.vue'
  4. import store from './store'
  5. import router from './router'
  6. import ElementPlus from 'element-plus'
  7. import 'element-plus/dist/index.css'
  8. import zhCn from 'element-plus/es/locale/lang/zh-cn'
  9. import i18n from './i18n'
  10. import 'virtual:svg-icons-register'
  11. import 'normalize.css'
  12. import 'virtual:uno.css'
  13. // Theme colors configuration
  14. const themeColors = {
  15. primary: '#ff6b6b',
  16. 'primary-light-3': '#ff8a8a',
  17. 'primary-light-5': '#ffa3a3',
  18. 'primary-light-7': '#ffbcbc',
  19. 'primary-light-8': '#ffd0d0',
  20. 'primary-light-9': '#ffe3e3',
  21. 'primary-dark-2': '#e55555',
  22. success: '#67c23a',
  23. 'success-light-3': '#85ce61',
  24. 'success-light-5': '#a6e4a1',
  25. 'success-light-7': '#c6f6d5',
  26. 'success-light-8': '#d4edda',
  27. 'success-light-9': '#e1f5e3',
  28. 'success-dark-2': '#55b82d',
  29. warning: '#e6a23c',
  30. 'warning-light-3': '#edb563',
  31. 'warning-light-5': '#f3d19e',
  32. 'warning-light-7': '#f9e4ba',
  33. 'warning-light-8': '#fce9cc',
  34. 'warning-light-9': '#fef0d9',
  35. 'warning-dark-2': '#d68830',
  36. danger: '#f56c6c',
  37. 'danger-light-3': '#f78989',
  38. 'danger-light-5': '#f9a8a8',
  39. 'danger-light-7': '#fcc7c7',
  40. 'danger-light-8': '#fdd9d9',
  41. 'danger-light-9': '#feebeb',
  42. 'danger-dark-2': '#dd5960',
  43. error: '#f56c6c',
  44. 'error-light-3': '#f78989',
  45. 'error-light-5': '#f9a8a8',
  46. 'error-light-7': '#fcc7c7',
  47. 'error-light-8': '#fdd9d9',
  48. 'error-light-9': '#feebeb',
  49. info: '#909399',
  50. 'info-light-3': '#a6a9ad',
  51. 'info-light-5': '#b1b3b9',
  52. 'info-light-7': '#d3d4d6',
  53. 'info-light-8': '#e4e4e7',
  54. 'info-light-9': '#f2f2f5',
  55. 'info-dark-2': '#7a7d82'
  56. }
  57. const root = document.documentElement
  58. Object.entries(themeColors).forEach(([key, value]) => {
  59. root.style.setProperty(`--el-color-${key}`, value)
  60. })
  61. const app = createApp(App)
  62. app.use(store)
  63. app.use(router)
  64. const currentLocale = zhCn
  65. app.use(ElementPlus, { locale: currentLocale })
  66. app.provide('i18n', i18n)
  67. app.config.globalProperties.$t = (key: string) => i18n.t(key)
  68. app.mount('#app')