你能让optgroup成为可选择的吗?
<mat-form-field class="h-1 text-xs w-full">
<mat-select formControlName="source">
<mat-option [value]="defaultSource">All</mat-option>
<mat-optgroup *ngFor="let source of sources"
[label]="source.source">
<mat-option *ngFor="let subSource of source.subSources"
[value]="{'source': source.source,'type': subSource.name}">
{{ subSource.name }}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>我希望能够选择顶级选项,而不仅仅是子选项。有可能吗?或者有解决这个问题的办法吗?
https://stackoverflow.com/questions/64640618
复制相似问题