css - 取消选择 ng2-smart-table 中的第一行搜索

标签 css angular sass hover

有什么方法可以取消选择 ng2-smart-table 中的第一行吗? ?请注意,一旦它被加载,第一行总是有 selected 类。问题是我想在 .scss 文件中添加一个 hover 来改变背景,但它永远不会改变第一个,但是所有的追寻行都可以改变背景.

tbody {
    tr:hover {
        background: #209e91;
    }
}

this例如,第一行在加载时有背景。

编辑:

查看源代码似乎是任意选择的:

数据集.ts

protected willSelect: string = 'first';
  ...
  select(): Row {
    if (this.getRows().length === 0) {
      return;
    }
    if (this.willSelect) {
      if (this.willSelect === 'first') {
        this.selectFirstRow();
      }
      if (this.willSelect === 'last') {
        this.selectLastRow();
      }
      this.willSelect = '';
    } else {
      this.selectFirstRow();
    }

    return this.selectedRow;
  }

最佳答案

添加 !important 以覆盖 selected 类的样式

tbody tr:hover {
    background: #209e91 !important;
}

关于css - 取消选择 ng2-smart-table 中的第一行搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39861516/

相关文章:

javascript - 如何使用 jQuery 删除 div 中的最后一个 BR 元素

html - 获取导航高度变为100%

node.js - 在ubuntu中安装 Node

css - 使用 laravel mix 编译 sass 后只显示 webkit

javascript - 如何在 Webpack 中编译多个 SCSS 文件?

css - IE11 css 只有实际工作的选择器

css - NReco PdfGenerator 字符或字母间距

angular - ag-grid ng build --prod 失败 : Maximum call stack size exceeded

node.js - Angular 2 服务 http post 不起作用

css - Foundation,如何设置像onclick这样的按钮?