0

如何faCircle在我的角度项目中加载(例如)的常规版本和实体版本?

如果我在app.component.ts以下声明:

import faCircle from '@fortawesome/fontawesome-pro-solid/faCircle';
import faCircle from '@fortawesome/fontawesome-pro-regular/faCircle';

fontawesome.library.add(faCircle);
fontawesome.library.add(faCircle);

在构建过程中我将面临以下错误:

src/app/app.component.ts(22,9) 中的错误:错误 TS2300:重复标识符“faCircle”。src/app/app.component.ts(24,51):错误 TS2300:重复标识符“faCircle”。

4

1 回答 1

1

愚蠢的打字稿问题......无论如何,这是我几分钟后找到的解决方案

import {faCircle as faCircleSolid} from '@fortawesome/fontawesome-pro-solid';
import {faCircle as faCircleRegular} from '@fortawesome/fontawesome-pro-regular';

fontawesome.library.add(faCircleSolid);
fontawesome.library.add(faCircleRegular);
于 2018-02-24T11:35:54.240 回答