在ExtJS使用 fontawesome 图标

发布时间 2023-03-24 08:28:45作者: 重庆熊猫

更新记录
2023年3月1日 从笔记迁移到博客。

转载请注明出处:https://www.cnblogs.com/cqpanda/p/17169162.html

ExtJS教程汇总:https://www.cnblogs.com/cqpanda/p/16328016.html

引入css包文件

<link rel="stylesheet" href="./fontawesome-free-6.3.0-web/css/all.css">

在按钮中直接使用

{
    xtype: 'button',
    text: 'abc',
    iconCls: 'fa-sharp fa-solid fa-magnifying-glass',
    scale: 'large'
},

在代码中直接使用

{
    xtype: 'button',
    text: 'abc',
    scale: 'large',
    handler: function () {
        Ext.Msg.alert('温馨提示','<i class="fa-solid fa-user"></i> aaa');
    }
},