primeng 文本编辑器图标和标签未显示

primeng text editor icon and label is not displaying

我在 Angular 项目中使用的 primeng 文本编辑器中没有看到按钮的图标。 enter image description here

我添加到模块中:import { EditorModule } from 'primeng/editor';

在下面的 HTML 中:

<p-editor class="fa fa-xxx"  [(ngModel)]="text1" [style]="{'height':'320px'}"></p-editor>
                <p>Value: {{text1||'empty'}}</p>

                <button pButton type="button" label="Clear" icon="fa-close" (click)="text1=null"></button>

                <hr style="border-top:0px;border-color:#dde3e6">

Primeng 依赖于 primeng 图标。如果你想使用图标,你必须明确安装它。

npm install primeicons --save 

现在,在您的 styles.css 中,您需要导入如下图标:

@import '../node_modules/primeicons/primeicons.css';

或者您可以在 angular.json 文件中添加图标,如下所示:

"styles": [
  "node_modules/primeicons/primeicons.css",
  "node_modules/primeng/resources/themes/nova-light/theme.css",
  "node_modules/primeng/resources/primeng.min.css",
  //...
]

此处提供所有详细信息PrimeNg get started