PrimeNG 切换按钮图标
PrimeNG ToggleButton icon
我正在尝试将 Font-awesome 中的图标添加到我的 ToggleButton
<p-toggleButton [(ngModel)]="checked" (onChange)="doThis"
aria-hidden="true">
<i class="fa fa-shield"></i> </p-toggleButton>
只能通过 pButton 实现吗?
您可以使用 onIcon 和 offIcon 属性自定义 toggleButton
:
<p-toggleButton [(ngModel)]="checked" onLabel="I confirm" offLabel="I reject" onIcon="fa fa-check" offIcon="fa fa-times"
[style]="{'width':'150px'}"></p-toggleButton>
我正在尝试将 Font-awesome 中的图标添加到我的 ToggleButton
<p-toggleButton [(ngModel)]="checked" (onChange)="doThis"
aria-hidden="true">
<i class="fa fa-shield"></i> </p-toggleButton>
只能通过 pButton 实现吗?
您可以使用 onIcon 和 offIcon 属性自定义 toggleButton
:
<p-toggleButton [(ngModel)]="checked" onLabel="I confirm" offLabel="I reject" onIcon="fa fa-check" offIcon="fa fa-times"
[style]="{'width':'150px'}"></p-toggleButton>