代码之家  ›  专栏  ›  技术社区  ›  harunB10

在ExtJS表列中设置Fontawesome图标

  •  0
  • harunB10  · 技术社区  · 6 年前

    如何在ExtJS中使用fontawesome。我想在表列中显示一个图标。

    例如,我有这个:

    widget2: {
        viewTemplate: {
            title: 'Today\'s calls',
            closable: false,
            layout: {
                type: 'table',
                width: '100%',
                columns: 2
            },
            items: [
                { html: '<i class="fas fa-home"></i>' },
                { html: '1,2' },
                { html: '1,3' },
                { html: '2,2' },
                { html: '3,2' },
                { html: '3,3' }
            ]
        }
    }
    

    但它只告诉我:

    enter image description here

    但是在我的主菜单中有菜单项 iconCls: 'fa fa-home' 而且有效。试着把它放在桌子上,但没用。

    有什么帮助吗?

    顺便说一下,我用的是ExtJS 6。

    1 回复  |  直到 6 年前
        1
  •  0
  •   beso9595 Spring boots    6 年前

    在css中创建一个类来定义 font-family 并将其传递给您决定用其制作图标的每个html组件: FIDDLE