Jer*_*606 3 angular-material angular
我正在尝试在我的输入右侧添加一个简单的图标以清除他的内容。
我不想在我的列表中添加“无”选项。
我想添加一个“清除”按钮。
实际上,一切正常,但是当我单击清除按钮时,选择正在显示...
这是一个测试代码:https : //stackblitz.com/edit/angular-mpbl8q
<mat-form-field>
<mat-label>State</mat-label>
<mat-select [(ngModel)]="currentState" name="State">
<mat-option *ngFor="let state of states" [value]="state">{{state}}</mat-option>
</mat-select>
<div matSuffix>
<mat-icon (click)="currentState = null">clear</mat-icon>
</div>
</mat-form-field>
Run Code Online (Sandbox Code Playgroud)
点击 clear 正在打开 mat-select
| 归档时间: |
|
| 查看次数: |
2287 次 |
| 最近记录: |