提交 833ba647 作者: 方治民 提交者: 方治民

feat: 改用 vite@4.2 支持的环境变量注入 html 实现 title 动态显示

上级 a2f3f59d
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
name="viewport" name="viewport"
content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"
/> />
<title><%= title %></title> <title>%VITE_GLOB_APP_TITLE%</title>
<link rel="icon" href="/favicon.ico" /> <link rel="icon" href="/favicon.ico" />
</head> </head>
<body> <body>
<script> <script>
;(() => { ;(() => {
var htmlRoot = document.getElementById('htmlRoot') let htmlRoot = document.getElementById('htmlRoot')
var theme = window.localStorage.getItem('__APP__DARK__MODE__') let theme = window.localStorage.getItem('__APP__DARK__MODE__')
if (htmlRoot && theme) { if (htmlRoot && theme) {
htmlRoot.setAttribute('data-theme', theme) htmlRoot.setAttribute('data-theme', theme)
theme = htmlRoot = null theme = htmlRoot = null
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<div class="app-loading-dots"> <div class="app-loading-dots">
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span> <span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
</div> </div>
<div class="app-loading-title"><%= title %></div> <div class="app-loading-title">%VITE_GLOB_APP_TITLE%</div>
</div> </div>
</div> </div>
</div> </div>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论