I also encountered this problem, but I used it in react, but I used a timer to make requests. I don’t think I have solved this problem very well. I really hope there are other methods. Remember to call me in time.
const timer = setTimeout(() => {
ScrollTrigger.refresh();
}, 2000);
// 清除定时器
return () => {
clearTimeout(timer);
};