【问题标题】:PrimeNG ToggleButton iconPrimeNG 切换按钮图标
【发布时间】:2019-01-15 18:55:50
【问题描述】:

我正在尝试将 Font-awesome 中的图标添加到我的 ToggleButton

<p-toggleButton [(ngModel)]="checked" (onChange)="doThis"
        aria-hidden="true">
    <i class="fa fa-shield"></i> </p-toggleButton>

只有pButton可以吗?

【问题讨论】:

    标签: html angular5 font-awesome primeng togglebutton


    【解决方案1】:

    您可以使用 onIconoffIcon 属性自定义toggleButton

    <p-toggleButton [(ngModel)]="checked" onLabel="I confirm" offLabel="I reject" onIcon="fa fa-check" offIcon="fa fa-times"
     [style]="{'width':'150px'}"></p-toggleButton>
    

    StackBlitz

    【讨论】:

    • 谢谢,这正是我想要的
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-05
    • 2022-01-25
    • 1970-01-01
    • 1970-01-01
    • 2013-06-20
    • 1970-01-01
    相关资源
    最近更新 更多