-
Beta Was this translation helpful? Give feedback.
Answered by
anntnzrb
Dec 8, 2025
Replies: 2 comments
-
|
把zone.js搞回来就好了 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
当 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
vm0100
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

当
nzOnOk返回的 Promise 在setTimeout中异步 resolve 时,loading 状态更新发生在 Angular zone 之外,导致变更检测不触发。解决方案:1) 确保导入了 zone.js;2) 对于 zoneless 应用,注入ChangeDetectorRef并在 resolve 后调用this.cdr.detectChanges();3) 或者使用this.ngZone.run(() => resolve(false))包装 resolve 调用。