我知道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