[Vuejs]-Why does window.scrollTo work cache scrollTo value

0πŸ‘

βœ…

I found a solution.

I don’t know why this works but using a setTimeout function fixed the problem.

setTimeout(() => {
  window.scrollTop(0, this.currentHeight);
}, 20);

Leave a comment