NG-ZORRO / ng-zorro-antd

Angular UI Component Library based on Ant Design
https://ng.ant.design
MIT License
8.87k stars 3.94k forks source link

抽屉重新打开如何避免重复渲染? #7122

Closed Cyclone77 closed 2 years ago

Cyclone77 commented 2 years ago

Reproduction link

https://stackblitz.com/edit/angular-omojih

Steps to reproduce

抽屉上输入的内容,展开的树,重新打开抽屉后消失了,恢复到第一次打开的状态了。

What is expected?

抽屉关闭不注销dom,重新打开还是之前的界面状态

What is actually happening?

重新打开抽屉重新渲染了内容

Environment Info
ng-zorro-antd 12.1.0
Browser google
zorro-bot[bot] commented 2 years ago

Translation of this issue:

How does the drawer re-open content do not re-rendeavado, use the previous rendering?

reproduction link

https://stackblitz.com/edit/angular-omojih

steps to reproduce

The content entered on the drawer, the expanded tree, disappeared after reopen the drawer, and returned to the first time.

What is expected?

Drawer close does not cancel DOM, reopen or previous interface status

What is actually happens?

Re-opening the drawer re-rendering the content

ENVIRONMENT INFO
Ng-Zorro-ANTD 12.1.0
Browser Google
Cyclone77 commented 2 years ago

申请不使用nzDrawerContent 模板来渲染,使用 @hsuanxyz

hsuanxyz commented 2 years ago

@Cyclone77 将内容投影移动到弹窗内会产生很多意外的问题,因此我从 v12 开始不再支持。直到 https://github.com/angular/angular/issues/8563 得到解决。

另外从开发角度上来说所有的输入内容应该都保存在 viewmodel 中,而不是在 view 中。