我知道nuxt.js的github库中有一些帖子介绍了这方面的内容,但我想知道在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