Mer*_*erc 8 fonts assets font-face vue.js nuxt.js
我知道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');
}
Run Code Online (Sandbox Code Playgroud)
感谢您在这里的一些澄清:D。干杯
Ĵ
Nic*_*nec 18
它在官方文档中有很好的解释:https : //nuxtjs.org/guide/assets/
assets\ 保留用于要处理的资产(例如,使用 webpack 连接 css)
static\可用于从根 url (static\img\test.jpg => http://example.fr/img/test.jpg )公开所有静态文件,无需任何处理
| 归档时间: |
|
| 查看次数: |
6873 次 |
| 最近记录: |