首页 > 解决方案 > 如何使用字体显示:交换;用于roboto字体类星体应用

问题描述

标签: webpackquasar-frameworkquasar

解决方案


注释掉并将其添加到您'roboto-font'的:extrasindex.template.html

<link rel="preconnect" href="https://fonts.gstatic.com">
<link rel="preload" href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&display=swap" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&display=swap" rel="stylesheet"></noscript>

如果您仅添加字体链接,Lighthouse 将为您提供的“消除渲染阻塞资源”的额外代码:

<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&display=swap" rel="stylesheet">

https://web.dev/render-blocking-resources/?utm_source=lighthouse&utm_medium=devtools


推荐阅读