[英]Hide second line on a multi-line mat-select
代码是
<mat-select >
<mat-option *ngFor="let type of source"
style="min-height: 48px; line-height: normal; height: auto; padding: 10px 20px;" [value]="type.value">
<div class="u-textSize14">{{type.displayName}}</div>
<div class="u-textSize12">{{type.hint}}</div>
</mat-option>
</mat-select>
当我 select 一个选项时,选中的项目显示为
“Standard UrlDomainName.com”,有什么办法可以在选择项目时隐藏第二行/提示并使其仅在垫子 select 打开时出现
要自定义您选择的选项,请在<mat-select>
中使用<mat-select-trigger>
> :
<mat-select [formControl]="foo">
<mat-select-trigger>{{foo.value ? foo.value[0] : ''}}</mat-select-trigger>
<mat-option *ngFor="let item of items" [value]="item.val">{{item.label}} - {{item.desc}}</mat-option>
</mat-select>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.