update:让VUE_APP_TITLE变量控制title

This commit is contained in:
hrz
2025-04-01 09:20:50 +08:00
parent f27e213d13
commit 9d39880e9d
+28 -22
View File
@@ -1,27 +1,33 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang=""> <html lang="">
<head>
<meta charset="utf-8"> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<title><%= htmlWebpackPlugin.options.title %></title> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<% if (htmlWebpackPlugin.options.cdn) { %> <title>
<% for (var i in htmlWebpackPlugin.options.cdn.css) { %> <%= process.env.VUE_APP_TITLE %>
<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>"> </title>
<% if (htmlWebpackPlugin.options.cdn) { %>
<% for (var i in htmlWebpackPlugin.options.cdn.css) { %>
<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>">
<% } %> <% } %>
<% } %> <% } %>
</head> </head>
<body>
<noscript> <body>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <noscript>
</noscript> <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
<div id="app"></div> Please enable it to continue.</strong>
<!-- built files will be auto injected --> </noscript>
<% if (htmlWebpackPlugin.options.cdn) { %> <div id="app"></div>
<% for (var i in htmlWebpackPlugin.options.cdn.js) { %> <!-- built files will be auto injected -->
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script> <% if (htmlWebpackPlugin.options.cdn) { %>
<% for (var i in htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %> <% } %>
<% } %> <% } %>
</body> </body>
</html> </html>