javascript - Html 加载字体 出问题了
本文介绍了javascript - Html 加载字体 出问题了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
搜索了半天,没有找到解决方法,求大神解答,万分感谢
bug
css
@font-face {
font-family: 'icomoon';
src: url('@{icons-font-path}/icomoon.eot?v=@{icons-version}');
src: url('@{icons-font-path}/icomoon.eot?v=@{icons-version}#iefix') format('embedded-opentype'),
url('@{icons-font-path}/icomoon.ttf?v=@{icons-version}#iefix') format('truetype'),
url('@{icons-font-path}/icomoon.woff?v=@{icons-version}') format('woff'),
url('@{icons-font-path}/icomoon.svg?v=@{icons-version}#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
webpack
{
test: /\.(ttf|eot|svg|woff)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'file-loader?name=/fonts/[name].[ext]',
}
解决方案
字体应该用url-loader啊
这篇关于javascript - Html 加载字体 出问题了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文