【发布时间】:2020-05-04 17:07:08
【问题描述】:
我正在尝试在 Nebular 中使用 Font-Awesome 图标。
我在 app.component.ts 文件中添加了以下几行
constructor(private iconLibraries: NbIconLibraries) {
this.iconLibraries.registerSvgPack('social-networks', {
'association': '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24">assets/images/building.svg</svg>',
'calendar1': '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24">assets/images/calendar.svg</svg>',
});
this.iconLibraries.setDefaultPack('social-networks');
}
并尝试像这样访问“日历1”图标。
{
title: 'View Events',
icon: 'calendar1',
link: 'events',
},
在控制台我收到以下错误 - 图标 'calendar1' 未在包 'eva' 中注册。检查图标名称或考虑切换图标包。
但图标仍然不可用。谁能告诉我我做错了什么。我关注了这篇文章-https://akveo.github.io/nebular/docs/guides/register-icon-pack#register-icon-pack
【问题讨论】:
标签: angular font-awesome nebular