main.tsx 650 B

123456789101112131415161718192021222324252627
  1. import { createRoot } from 'react-dom/client';
  2. import App from '@/App';
  3. import dayjs from 'dayjs';
  4. import 'dayjs/locale/zh-cn';
  5. import '@/style/global.less';
  6. import "@/style/tailwind.css";
  7. import '@fortawesome/fontawesome-free/css/all.min.css';
  8. // 日期 - 中文
  9. dayjs.locale('zh-cn');
  10. // 启动时应用主题(如果 localStorage 有记录)
  11. try {
  12. const theme = localStorage.getItem('app-theme-mode');
  13. if (theme) {
  14. document.documentElement.setAttribute('data-theme', theme);
  15. }
  16. } catch (e) {
  17. // ignore
  18. }
  19. // React@v18 Render 方法
  20. const root = createRoot(document.getElementById('root')!);
  21. root.render(
  22. <App />
  23. );