【发布时间】:2018-05-22 15:10:45
【问题描述】:
我有一个复选框列表,它是不同部门的复选框(每个部门都有自己的颜色)当框未被选中时,只有边框是在部门的颜色时被选中的Backgroud更改为Asigh颜色
box-shadow 可以正常工作,但不能改变背景(保持蓝色), 这是我目前的代码:
<label class="custom-control custom-checkbox" *ngFor="let department of departments">
<input type="checkbox" class="custom-control-input" [ngStyle]="{'background-color':checked===true? department.color:'white'}">
<span class="custom-control-indicator" [ngStyle]="{'box-shadow': '0 0 1px 1px' + department.color}" > </span>
<span class="custom-control-description text-capitalize">{{department.id}}</span>
</label>
【问题讨论】:
标签: html css angular bootstrap-4