【发布时间】:2018-11-13 10:59:25
【问题描述】:
我知道 nuxt.js github repo 中的一些帖子对此有所介绍,但我想知道在 nuxt.js 中使用字体文件的正确方法是什么。
到目前为止,我们将它们放在/static/fonts 目录中,但其他人使用assets 来存储字体文件。
有什么区别?其中一个选项更好吗?如果是,为什么?
还有不同的方法可以包含它们。 这样的路径是否正确:
@font-face {
font-family: 'FontName';
font-weight: normal;
src: url('~static/fonts/font.file.eot'); /* IE9 Compat Mode */
src: url('~static/fonts/font.file.woff') format('woff'),
url('~static/fonts/font.file.otf') format('otf'),
url('~static/fonts/font.file.eot') format('eot');
}
感谢您的澄清:D。 干杯
J
【问题讨论】:
-
嘿,看看这个answer。我觉得有点相关
标签: vue.js fonts font-face assets nuxt.js