【发布时间】:2019-12-04 16:20:48
【问题描述】:
我正在使用 ngb-highlight 选择器来突出显示表格中包含的一些术语。现在,我想添加背景颜色,并且按照在线文档,我使用了 highlightClass 输入并定义了一个包含这个新属性的自定义类。
使用它的默认类,它可以改变字体粗细。新类不起作用。
员工列表.component.html
<tr *ngFor="let employee of employees$ | async; index as i">
<th scope="row">{{ i + 1 }}</th>
<td>
<ngb-highlight [result]="employee.firstname" [term]="filter.value" [highlightClass]="'employee-highlight'"></ngb-highlight>
</td>
<td>
<ngb-highlight [result]="employee.lastname" [term]="filter.value" [highlightClass]="'employee-highlight'"></ngb-highlight>
</td>
<td>
<ngb-highlight [result]="employee.email" [term]="filter.value" [highlightClass]="'employee-highlight'"></ngb-highlight>
</td>
<td>
<ngb-highlight [result]="employee.role.name" [term]="filter.value" [highlightClass]="'employee-highlight'"></ngb-highlight>
</td>
</tr>
员工列表.component.scss
.employee-highlight {
background-color: yellow;
}
我希望背景颜色为黄色,但样式不会改变。我能做什么?
【问题讨论】:
标签: angular ng-bootstrap