使用ng-zorro在IE 11 下文本框输入很慢
问题描述
使用ng-zorro在IE 11 下文本框输入很慢,敲一下键盘至少要反应1秒才会显示内容。
切换chrome就没有问题,不知道什么原因?
问题出现的环境背景及自己尝试过哪些方法
之前以为是版本与环境不兼容,后来升级了 ng-zorro、Angular都升级到最新的版本也有问题。
请大神们帮帮忙,我们系统要6月底上线,现在出现这个问题。。非常紧急!!
相关代码
{
"name": "zorro-app",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --optimization=true",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^7.2.15",
"@angular/common": "^7.2.15",
"@angular/compiler": "^7.2.15",
"@angular/core": "^7.2.15",
"@angular/forms": "^7.2.15",
"@angular/http": "^7.2.15",
"@angular/platform-browser": "^7.2.15",
"@angular/platform-browser-dynamic": "^7.2.15",
"@angular/router": "^7.2.15",
"@auth0/angular-jwt": "^2.1.0",
"@ngx-translate/core": "^10.0.2",
"@ngx-translate/http-loader": "^3.0.1",
"babel-polyfill": "^6.26.0",
"classlist.js": "^1.1.20150312",
"core-js": "^2.6.5",
"moment": "^2.24.0",
"ng-zorro-antd": "^7.3.3",
"ng2-ckeditor": "^1.2.2",
"ngx-translate-multi-http-loader": "^2.1.2",
"rxjs": "^6.5.2",
"tslib": "^1.9.0",
"web-animations-js": "^2.3.1",
"zone.js": "~0.8.29"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.13.9",
"@angular/cli": "~7.1.4",
"@angular/compiler-cli": "^7.2.15",
"@angular/language-service": "^7.2.15",
"@types/jasmine": "~2.8.16",
"@types/jasminewd2": "~2.0.6",
"@types/node": "~8.9.4",
"codelyzer": "~5.0.1",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.5",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.2",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.2.2"
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
打开chrome开发者工具,选择performance选项,开始录制,然后在输入框中输入,大概5-10秒后,结束录制。
通过Event Log中查看耗时任务。
如果发现耗时较多的任务是脏检查机制,即detectChanges方法的调用。
则需要将input组件隔离开,并添加ChangeDetectionStrategy.OnPush策略,避免input的操作造成频繁的脏检查的触发,如果觉得麻烦,可以使用nz-input-group组件,该组件已做了ChangeDetectionStrategy.OnPush的优化