3 回答

TA貢獻1895條經(jīng)驗 獲得超7個贊
要刪除墊輸入自動填充,background color您可以簡單地使用 在您的主要 style.scss/css您可以使用
.mat-form-field-autofill-control{
background-color: wheat; // your prefered color
}

TA貢獻1844條經(jīng)驗 獲得超8個贊
對于角度 10
組件.sccs
.buscador {
color: white !important;
}
:host ::ng-deep .mat-form-field-underline {
background-color: white !important;
}
:host ::ng-deep .mat-focused .mat-form-field-underline .mat-form-field-ripple {
background-color: white !important;
}
組件.html
<form>
<mat-form-field>
<mat-label id="placeholder" class="buscador">Buscar...</mat-label>
<input type="text" aria-label="Number" matInput [formControl]="myControl" [matAutocomplete]="auto" type="text" name="option" required minlength="3">
<mat-autocomplete #auto="matAutocomplete" name="option">
<mat-option *ngFor="let option of options | async" [value]="option">
{{option}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>

TA貢獻1793條經(jīng)驗 獲得超6個贊
我確實找到了如何更改它,需要添加此代碼來更改輸入的類顏色。
::ng-deep input.mat-input-element { color: white; }
- 3 回答
- 0 關(guān)注
- 226 瀏覽
添加回答
舉報