css - 如何在 ng2-smart-table 上显示自定义图标?

标签 css angular ng2-smart-table nebular ngx-admin

我无法在 ng2-smart-tableactions 选项卡上显示自定义图标。我已经安装了来自 Akevo TeamEva 图标,并且我想使用它们。我已更改编辑按钮以显示一些自定义图标,但问题是没有出现任何内容。在删除的左侧,必须出现一个画笔图标。

这是有问题的图像:

enter image description here

这是代码:

 settings = {
    edit: {
      editButtonContent: '<nb-icon icon="brush"></nb-icon>',
      saveButtonContent: '<nb-icon icon="checkmark"></nb-icon>',
      cancelButtonContent: '<nb-icon icon="close-circle"></nb-icon>'
    },
    columns: {
      device: {
        title: 'Device',
        sortDirection: 'asc'
      },
      type: {
        title: 'Type',
        sort: false,
        filter: false
      },
      serialNumber: {
        title: 'Serial Number'
      },
      status: {
        title: 'Status'
      }
    }
  };

最佳答案

试试这个:

settings = {
hideSubHeader: true,
actions: {
  custom: [
    {
      name: 'edit',
      title: '<nb-icon icon="brush"></nb-icon>'
    },
    {
      name: 'save',
      title: '<nb-icon icon="checkmark"></nb-icon>'
    },
    {
      name: 'cancel',
      title: '<nb-icon icon="close-circle"></nb-icon>'
    }
  ],
  add: false,
  edit: false,
  delete: false
}
...
};

希望这对您有用!

关于css - 如何在 ng2-smart-table 上显示自定义图标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57036330/

相关文章:

html - 为 IE8 上的表中的最后一个 td 提供宽度

jquery - 在鼠标悬停时显示搜索图标

angular - 将 *ngFor 与迭代器一起使用的正确方法是什么?

javascript - 错误解决后,mat-form-field 不会删除 mat-form-field-invalid 类

angular - Ng2-智能表 : Use drop-downs or date pickers in inline editing

angular - 模块 'Ng2SmartTableModule' 声明的意外模块 'AppModule'

html - 如何使用css从顶部和底部对齐div内中心的文本

html - CSS 多背景

javascript - 必须在订阅中嵌套服务调用的 Angular 5 activatedroute

angular - 如何删除 ng2-smart-table 中的一行