<mat-form-field>
<mat-select id="xx-id" [(value)]="a" name="xx">
<mat-option *ngFor="let lvl of lvls" [value]="lvl">
{{lvl}}
</mat-option>
</mat-select>
</mat-form-field>
[(value)]也可以换成[(ngModel)]
"a"是默认值,
component:
this.a = lvls[0];
Angular2 material select 默认值
最新推荐文章于 2024-04-15 09:39:12 发布