我想改变材料多选值css。
<mat-form-field class="mat-form-field-fluid">
<mat-select placeholder="Kullanıcı Yetkileri" [(value)]="selectedPermissions" multiple>
<mat-option *ngFor="let permission of filteredPermissions | async" [value]="permission">{{permission.name}}</mat-option>
</mat-select>
</mat-form-field>当我检查浏览器源代码中的选定值时,我看到如下所示:
<span class="ng-tns-c22-16 ng-star-inserted">selection-1,selection-2</span>因此,我想通过包装一个span将一个css类设置为选定的值。
如何更改材料的css多选的选定值。
谢谢。
发布于 2020-01-27 22:25:44
具体视情况而定,但您可能需要禁用包含<mat-form-field>的组件的封装
在你的@Component装饰器上添加:
encapsulation: ViewEncapsulation.None这样,您就可以使用浏览器检查器检查组件并编写适当的CSS规则。
https://stackoverflow.com/questions/59932870
复制相似问题