因此,我有我的svg图像,我想把它转换成图标,使用Fontello来转换并导入到我的nuxt项目中。但配置似乎不起作用
这就是我的nuxt.config.js文件中的内容
head: {
css: [
'~/assets/css/main.css',
'~/assets/css/animation.css',
'~/assets/css/fontello.css',
'~/assets/css/fontello-ie7.css',
'~/assets/css/fontello-ie7-codes.css', /*if IE 7 */
],
}在我的html页面中,我使用
<i @click="goToChat" class="the-icons demo-icon icon-chat menu ic-menu"></i>还有我的css文件
.demo-icon {
font-family: "fontello";
font-style: normal;
font-weight: normal;
speak: none;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: 0.2em;
text-align: center;
font-variant: normal;
text-transform: none;
line-height: 1em;
margin-left: 0.2em;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}问题是css文件不能读font-family: "fontello";,我配置错了吗?
发布于 2020-03-10 16:02:17
就在今晚,我无意中发现了同样的问题,并搜索了如何做到这一点,我试过您的配置,它可以工作。您是否也导入了包含实际字体的字体文件夹?
如果打开fontello.css文件,您将看到带有url引用thos字体文件的@字体-face属性,确保url是正确的(最简单的解决方案是从fontello.zip导入字体和css文件夹),以便您的资产folder看起来类似于资产css -字体-图像。
https://stackoverflow.com/questions/60292060
复制相似问题