要解决Angular材料密码字段在IE中没有正确渲染的问题,可以尝试以下步骤:
确保您的应用程序使用了最新版本的Angular材料库和IE浏览器。
在你的Angular应用程序的polyfills.ts文件中添加IE所需的polyfills。在polyfills.ts文件中,取消注释以下两行:
// 解决IE浏览器中的ES6兼容性问题
// import 'core-js/es6/symbol';
// import 'core-js/es6/object';
// 解决IE浏览器中的ES7兼容性问题
// import 'core-js/es7/reflect';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
// 其他导入的模块
],
// 其他配置信息
})
export class AppModule { }
/* 解决IE中Angular材料样式渲染问题 */
@-ms-viewport {
width: device-width;
}
.mat-form-field-appearance-legacy .mat-form-field-label {
width: auto !important;
}
.mat-form-field-appearance-legacy .mat-form-field-underline {
display: none !important;
}
.mat-form-field-appearance-legacy .mat-form-field-ripple {
display: none !important;
}
这些步骤应该能够解决Angular材料密码字段在IE中没有正确渲染的问题。