我在我的应用程序中使用了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}}
您是不是要创建此list with selection?
我尝试在IE 11浏览器中对此示例进行测试,并提供了100多个选项,但看起来对我而言效果很好。
我建议您尝试使用官方文档中提到的示例代码进行测试。如果问题仍然存在,请尝试共享示例代码。
它可以帮助我们更好地理解问题。我们将尝试对其进行测试以检查问题。
尝试使用* cdkVirtualFor而不是* ngFor后为我工作。