index.html 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>Art Design Pro</title>
  5. <meta charset="UTF-8" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
  7. <meta name="description" content="Art Design Pro - A modern admin dashboard template built with Vue 3, TypeScript, and Element Plus." />
  8. <link rel="shortcut icon" type="image/x-icon" href="src/assets/img/favicon.ico" />
  9. <style>
  10. /* 防止页面刷新时白屏的初始样式 */
  11. html {
  12. background-color: #fafbfc;
  13. }
  14. html.dark {
  15. background-color: #070707;
  16. }
  17. </style>
  18. <script>
  19. // 初始化 html class 主题属性
  20. ;(function () {
  21. try {
  22. if (typeof Storage === 'undefined' || !window.localStorage) {
  23. return
  24. }
  25. const themeType = localStorage.getItem('sys-theme')
  26. if (themeType === 'dark') {
  27. document.documentElement.classList.add('dark')
  28. }
  29. } catch (e) {
  30. console.warn('Failed to apply initial theme:', e)
  31. }
  32. })()
  33. </script>
  34. </head>
  35. <body>
  36. <div id="app"></div>
  37. <script type="module" src="/src/main.ts"></script>
  38. </body>
  39. </html>