【问题标题】:mat-selection-list component is very slow in IE11 and working fine in other browsersmat-selection-list 组件在 IE11 中非常慢,在其他浏览器中运行良好
【发布时间】:2020-05-27 21:14:29
【问题描述】:

我在我的应用程序中使用 mat-selection-list 和 100 多个带有复选框的选项,它在 chrome、firefox 和 edge 中工作,但在 IE11 中它非常慢并且挂起。

这里是示例代码:

<mat-selection-list #options [(ngModel)]="selectOptions" [compareWith]="compareFunction" (selectionChange)="onOptionSel($event)">
<mat-list-option *ngFor="let cio of ciOptions" checkboxPosition="before" [value]="cio" aria-label="cio">
{{cio.label}}

【问题讨论】:

  • 您缺少示例代码
  • 您提供的信息很难帮助您解决问题。尽量让其他人更容易重现/分析您的问题。提供更多上下文和更多代码,不要忘记提出问题。

标签: angular performance angular-material internet-explorer-11


【解决方案1】:

在尝试 *cdkVirtualFor 而不是 *ngFor 之后,它对我有用。

【讨论】:

  • 感谢您发布此问题的解决方案。我建议您尝试在 48 小时后标记您自己对这个问题的答案,当它可以标记时。它可以在未来帮助其他社区成员解决类似的问题。感谢您的理解。
猜你喜欢
  • 2017-01-25
  • 1970-01-01
  • 2013-09-23
  • 2023-04-01
  • 1970-01-01
  • 2011-04-15
  • 1970-01-01
  • 2012-02-07
  • 1970-01-01
相关资源
最近更新 更多