在styles.css或styles.scss中增加以下代码段:
// for Angular 11
.mat-form-field-label, .mat-label {
font-weight: 600;
}
// for both Angular 9 and 11
.mat-form-field, .mat-select {
font-family: Roboto, sans-serif !important;
font-size: 14px !important;
}
这个问题可能是由字体的变化导致的,要解决这个问题,我们需要在样式文件中设置一些新的样式。这个解决方法适用于Angular 9、10和11。