低于在 nuxt.config.js 的 head 标记中内联字体声明的正确方法。尝试遵循https://web.dev/font-best-practices/中字体加载策略的最佳实践。样式标签似乎不起作用。谁能帮忙?!
link: [
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' },
{ rel: 'dns-prefetch', href: 'https://fonts.gstatic.com' },
{
rel: 'preconnect',
href: 'https://fonts.gstatic.com',
crossorigin: 'anonymous',
},
{
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;700&subset=latin&display=swap',
},
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
],
style: [
{
cssText:
'@font-face { font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segou UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif }',
type: 'text/css',
},
{
cssText:
'body { font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segou UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif }',
type: 'text/css',
},
],