【问题标题】:how to import google-font with vitejs?如何使用 vitejs 导入 google-font?
【发布时间】:2022-11-12 22:58:47
【问题描述】:

google-font 和 vitejs 的问题

我想知道如何为我的 Vite 项目导入 google-font(或其他字体),尽管 Vite 已经在 index.html 中为 css、scss、sass 等进行了所有配置,但是没有关于如何配置的内容谷歌字体的 Vite。请帮我。 (我的配置 = Vite -> React -> TypeScript -> sass)。

【问题讨论】:

    标签: vite google-fonts


    【解决方案1】:

    我遇到了同样的问题,所以我使用了<link> 提供的谷歌字体,直到我找到FontSource.

    它允许通过 npm 导入谷歌字体.从那时起,由于 DX 及其benefits.

    https://fontsource.org/docs/getting-started

    希望能帮助到你,钆.

    【讨论】:

      猜你喜欢
      • 2022-12-04
      • 1970-01-01
      • 2023-01-23
      • 2018-12-06
      • 2022-06-22
      • 2017-11-24
      • 2019-07-12
      • 2017-10-28
      • 1970-01-01
      相关资源
      最近更新 更多