我有一个md-select
内部md-grid-list
,它是md-card
内容的一部分,如下所示:
<md-grid-tile>
<md-select id="typ" [(ngModel)]="doc.docType" placeholder="Typ Dokumentu">
<md-option *ngFor="let state of states" [value]="state">{{ state}}</md-option>
</md-select>
<button class="clear" [hidden]="!doc.docType" (click)="clear('docType')">X</button>
</md-grid-tile>
如您所见,“X”按钮在选择值时呈现,并在单击事件时将其清除。只需将md-select
模型属性设置为undefined
现在,我想将“X”按钮放置在mat-select-arrow
隐藏/覆盖它的上方。
你能帮我设置“清除”按钮的样式以向左移动并隐藏那个箭头吗?设置margin-right
时它只移动整个md-select
左边但不覆盖箭头。
我相信这对很多人都有帮助。
谢谢!