使用变化检测器 ref 手动检测变化。
getBGColour(shift) { this.cd.detectChanges(); let val = 0; const vals = []; . .
不要忘记在构造函数中注入 ChangeDetectorRef