Kaynağa Gözat

修复标题字体加载慢导致换行: @font-face 加 font-display:swap + 标题 white-space:nowrap

画安 2 hafta önce
ebeveyn
işleme
3be6e4a501

+ 1 - 1
public/index.html

@@ -5,7 +5,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    
+
     <link rel="preconnect" href="https://cdn.staticfile.org">
     <link rel="preconnect" href="https://cdn.staticfile.org">
 
 
     <script src="<%= BASE_URL %>config.js"></script>
     <script src="<%= BASE_URL %>config.js"></script>

+ 1 - 0
src/layouts/DashboardLayout.vue

@@ -228,6 +228,7 @@ export default {
     text-align: center;
     text-align: center;
     font-style: normal;
     font-style: normal;
     text-transform: none;
     text-transform: none;
+    white-space: nowrap;
 }
 }
 
 
 .frame-left {
 .frame-left {

+ 1 - 0
src/layouts/LoginLayout.vue

@@ -119,6 +119,7 @@ export default {
     text-align: center;
     text-align: center;
     font-style: normal;
     font-style: normal;
     text-transform: none;
     text-transform: none;
+    white-space: nowrap;
 }
 }
 
 
 .frame-left {
 .frame-left {

+ 1 - 0
src/styles/base.css

@@ -7,6 +7,7 @@
   src: url('../assets/fonts/YouSheBiaoTiHei_Regular.ttf') format('truetype');
   src: url('../assets/fonts/YouSheBiaoTiHei_Regular.ttf') format('truetype');
   font-weight: normal;
   font-weight: normal;
   font-style: normal;
   font-style: normal;
+  font-display: swap;
 }
 }
 
 
 
 

+ 1 - 0
src/views/Login.vue

@@ -163,6 +163,7 @@ export default {
   text-align: center;
   text-align: center;
   font-style: normal;
   font-style: normal;
   text-transform: none;
   text-transform: none;
+  white-space: nowrap;
 }
 }
 
 
 .right-panel {
 .right-panel {