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

nzAutosize性能差 #1370

Closed
liwei511 opened this issue Apr 24, 2018 · 2 comments · Fixed by #2593
Closed

nzAutosize性能差 #1370

liwei511 opened this issue Apr 24, 2018 · 2 comments · Fixed by #2593

Comments

@liwei511
Copy link

liwei511 commented Apr 24, 2018

Version

0.7.0-beta.3

Environment

Windows10专业版 、Google Chrome版本 66.0.3359.27(正式版本)dev (64 位), 0.7.0-beta.3

Reproduction link

https://stackblitz.com/edit/ng-zorro-antd-setup-tuaoti?file=app/app.component.html

Steps to reproduce

接口请求30ms以内,页面加载却10000ms左右。

What is expected?

支持[attr.row]="d.rows"。 或者[nzAutosize]="true"优化性能。

What is actually happening?

1: row="4"无效;
2: [nzAutosize]="true"当textarea有一百个时,加载特别慢。

Other?

<div class="api-one" *ngFor="let d of data; index as di"> <h3 *ngIf="di===0||d.service!==data[di-1].service" [id]="d.service"><nz-tag [nzColor]="'#87d068'">{{d.service}}</nz-tag></h3> <h2 [id]="d.hid">{{d.api}}</h2> <div class="api-return">返回值:{{d.return}}</div> <div class="api-doc"> <textarea [attr.row]="d.rows" nz-input [ngModel]="d.doc" readonly></textarea> </div> </div>

@liwei511
Copy link
Author

liwei511 commented Apr 24, 2018

item.rows = item.doc.split('\n').length * 21 + 10 + 'px'; // line-height + padding
目前的解决方法是,算出高度,设置[style.height]="d.rows"。
1秒内渲染完成。期待ant更新算法,解决bug。

@hsuanxyz
Copy link
Member

hsuanxyz commented May 2, 2018

textarea[rows] 不是 textarea[row]textarea

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

Successfully merging a pull request may close this issue.

3 participants