<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];
<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];