Closed werts closed 3 years ago
[https://stackblitz.com/Edit/ng-zoro-antd-icon-issue?file=src/app/app.module.ts](https://stackblitz.com/edit/ng- /oro-antd- Icon-Issue? file = src / app / app.module.ts)
Cancel the comment under AppComponent, use the ITEMS of the comment to replace the member attribute Items
normal work
Browser card
ENVIRONMENT | INFO |
---|---|
Ng-Zorro-ANTD | 11.2.0 |
Browser | Chrome version 89.0.4389.72 (official version) (64-bit) |
https://ng.ant.design/docs/faq/zh#%E6%88%91%E7%9A%84%E9%A1%B5%E9%9D%A2%E5%8D%A1%E6%AD%BB%E4%BA%86%EF%BC%8C%E5%87%BD%E6%95%B0%E4%B8%8D%E5%81%9C%E7%9A%84%E5%9C%A8%E6%89%A7%E8%A1%8C 使用 getter,又没有trackBy,angular 每次拿到的都是新对象,相当于你写了一个死循环,页面肯定会卡死
如果不使用icon,则不会导致卡死 @vthinkxie
icon 内部会根据传入对象内容进行重新渲染
@vthinkxie 还是没有特别理解,能不能帮忙说说到底是怎么个机制呢?感谢
Reproduction link
https://stackblitz.com/edit/ng-zoro-antd-icon-issue?file=src/app/app.module.ts
Steps to reproduce
取消AppComponent下的注释,使用注释的getter的items代替成员属性items即可重现
What is expected?
正常工作
What is actually happening?
浏览器卡死