Can’t get DOM width or height. Please check dom.clientWidth and dom.clientHeight. They should not be 0.For example, you may need to call this in the callback of window.onload.
产生该警告的原因在于未获取到宽高,但是在代码中已经添加了style=“height: 400px; width: 600px;”。
<nz-modal
[nzTitle]="modalTemplate"
[(nzVisible)]="showLast"
[nzFooter]="null"
[nzWidth]="1200"
(nzOnCancel)="handleCancel()"
(nzOnOk)="handleOk()"
>
<nz-card nzBordered="false">
<div nz-row nzJustify="center">
<div nz-col nzSpan="24" style="height: 400px; width: 600px;" echarts [options]="bigBuildOption"></div>
</div>
</nz-card>
</nz-modal>
尝试将echart的div部分移到最外层,可以显示。
最后发现是nz-card标签缺少了*nzModalContent,在angular升级前是没有的,而升级后需要添加这个才能显示。