【问题标题】:Custom Icons on smart-table component angular智能表组件角度上的自定义图标
【发布时间】:2020-01-14 10:24:42
【问题描述】:

它无法在操作按钮中显示图标,当我检查页面时,它不会加载我“:: before”

我在按钮中看不到图标!

如何将 ionicons 替换为 eva 图标。

我将智能表添加到我的项目中,但未能成功显示 eva 图标包的图标。我遵循本指南:

https://github.com/akveo/ng2-smart-table

http://akveo.com/ngx-admin/pages/tables/smart-table 中的工作示例

<a class="ng2-smart-action ng2-smart-action-add-add ng-star-inserted" href="#">
<i class="nb-plus">
  ::before == $0
</i></a>

检查我的代码

<a class="ng2-smart-action ng2-smart-action-add-add ng-star-inserted" href="#"> == $0
<i class="nb-plus"></i></a>

我的设置:

settings = {
          add: {
            addButtonContent: '<i class="nb-plus"></i>',
            createButtonContent: '<i class="nb-checkmark"></i>',
            cancelButtonContent: '<i class="nb-close"></i>',
          },
          edit: {
            editButtonContent: '<i class="nb-edit"></i>',
            saveButtonContent: '<i class="nb-checkmark"></i>',
            cancelButtonContent: '<i class="nb-close"></i>',
          },
          delete: {
            deleteButtonContent: '<i class="nb-trash"></i>',
            confirmDelete: true,
          },
          columns: {
            id: {
              title: 'ID',
              type: 'number',
            },
            firstName: {
              title: 'First Name',
              type: 'string',
            },
            lastName: {
              title: 'Last Name',
              type: 'string',
            },
            username: {
              title: 'Username',
              type: 'string',
            },
            email: {
              title: 'E-mail',
              type: 'string',

            },
            age: {
              title: 'Age',
              type: 'number',
            },
          },
        };

我需要更改和显示操作按钮上的图标

【问题讨论】:

    标签: angular scss-mixins ng2-smart-table nebular


    【解决方案1】:

    如果你觉得我的回答有用就点个赞吧。

    原因:查看给定模板 https://github.com/akveo/ng2-smart-table/blob/master/package.json 的 package.json 文件。

    1. 你会发现需要安装"nebular-icons": "^1.1.0", 使用命令 npm i nebular-icons@1.1.0

    2. 在项目的 angular.json 文件的样式数组中添加 "node_modules/nebular-icons/scss/nebular-icons.scss" 以包含星云图标样式。 参考https://github.com/akveo/ng2-smart-table/blob/master/angular.json

    3. 使用 ng serve -o 运行项目

    【讨论】:

    • 感谢您抽出宝贵的时间回答,很遗憾它不起作用。
    • 你能在github上托管你的项目代码吗?那我可以看看吗?
    • 你是对的,我弄错了,这就是图标没有显示的原因。你的解释是正确的。为我解决了,非常感谢。
    猜你喜欢
    • 2018-09-17
    • 2016-03-16
    • 2018-05-13
    • 1970-01-01
    • 2015-06-11
    • 1970-01-01
    • 1970-01-01
    • 2020-08-08
    • 2016-02-25
    相关资源
    最近更新 更多