Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Cyclone77 opened this issue Dec 17, 2021 · 3 comments
Closed

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

Cyclone77 opened this issue Dec 17, 2021 · 3 comments

Comments

@Cyclone77
Copy link

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
Copy link

zorro-bot bot commented Dec 17, 2021

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 Cyclone77 changed the title 抽屉重新打开内容如何不重新渲染,用之前渲染的? 抽屉重新打开内容如何不重新渲染,用之前渲染的内容? Dec 17, 2021
@Cyclone77 Cyclone77 changed the title 抽屉重新打开内容如何不重新渲染,用之前渲染的内容? 抽屉重新打开内容如何不重新渲染,用之前渲染过的内容? Dec 20, 2021
@Cyclone77
Copy link
Author

Cyclone77 commented Dec 23, 2021

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

@Cyclone77 Cyclone77 changed the title 抽屉重新打开内容如何不重新渲染,用之前渲染过的内容? 抽屉重新打开如何避免重复渲染? Dec 23, 2021
@hsuanxyz
Copy link
Member

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants