Angular 悬停时,更改ng select中项目的背景色
我有一个angular应用程序,其中使用了ng select。将鼠标悬停在下拉列表中的某个项目上时,我想更改该值的背景色。我怎样才能做到这一点? 以下是我的选择:Angular 悬停时,更改ng select中项目的背景色,angular,angular-ngselect,Angular,Angular Ngselect,我有一个angular应用程序,其中使用了ng select。将鼠标悬停在下拉列表中的某个项目上时,我想更改该值的背景色。我怎样才能做到这一点? 以下是我的选择: <ng-select [items]="filters.areaOfExpertises" placeholder="Area of Expertise" (clear)="clearAOE()" bindLabel="d
<ng-select [items]="filters.areaOfExpertises" placeholder="Area of Expertise" (clear)="clearAOE()"
bindLabel="displayName" [(ngModel)]="filterBy.areaOfExpertise" (change)="onAOESelected($event)">
<ng-template ng-option-tmp let-item="item" let-search="searchTerm">
<span class='display-name option-highlight' [ngOptionHighlight]="search" [title]="item.displayName">
{{item.displayName}}
</span>
</ng-template>
</ng-select>
{{item.displayName}
我尝试过以下几种方法:
我能够按如下方式实现此功能:
::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-marked { background-color: #0E5981; }