mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 04:46:26 +00:00
- 提取应用引导逻辑至 useAppBootstrap 组合式函数 - 增强日期选择器组件,支持全类型与格式自动推导 - 修复资源泄漏:清理 RAF、定时器、事件与 mitt 监听 - 修复退出登录逻辑与异步导出流程 - 迁移 ::v-deep 至 Vue 3 标准 :deep 语法 - 移除调试日志并改进类型定义与注释文档
57 lines
1.7 KiB
HTML
Executable File
57 lines
1.7 KiB
HTML
Executable File
<!doctype html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<title>%VITE_APP_TITLE%</title>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<meta name="description" content="Vue3 + Vite + TypeScript + Element-Plus 的后台管理模板" />
|
|
<meta
|
|
name="keywords"
|
|
content="vue,element-plus,typescript,vue-element-admin,vue3-element-admin"
|
|
/>
|
|
<link rel="shortcut icon" type="image/x-icon" href="src/assets/images/favicon.png" />
|
|
|
|
<style>
|
|
/* 防止 Vue 加载前出现白屏:背景色与主题初始 class 同步 */
|
|
html {
|
|
background-color: #fafbfc;
|
|
}
|
|
|
|
html.dark {
|
|
background-color: #070707;
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
/**
|
|
* 在 Vue 挂载前同步主题 class。
|
|
*
|
|
* Vue 初始化后 useTheme 会接管主题管理,
|
|
* 但在此之前若用户之前选择了暗色主题,html 缺少 "dark" class 会导致闪烁。
|
|
* 此处直接从 localStorage 读取主题偏好并提前设置 class。
|
|
*
|
|
* key "sys-theme" 须与 StorageConfig.THEME_KEY 保持一致。
|
|
*/
|
|
(function () {
|
|
try {
|
|
if (typeof Storage === "undefined" || !window.localStorage) {
|
|
return;
|
|
}
|
|
|
|
const themeType = localStorage.getItem("sys-theme");
|
|
if (themeType === "dark") {
|
|
document.documentElement.classList.add("dark");
|
|
}
|
|
} catch (e) {
|
|
console.warn("Failed to apply initial theme:", e);
|
|
}
|
|
})();
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="app"></div>
|
|
<script type="module" src="/src/main.ts"></script>
|
|
</body>
|
|
</html>
|