有什么方法可以取消选择 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/