Get body scroll bar scrollTop exception in vue beforeDestroy cycle

code:

beforeDestroy () {

var scrollTop = window.pageYOffset
    || document.documentElement.scrollTop
    || document.body.scrollTop
    || 0;
console.log(window.pageYOffset);
console.log(document.documentElement.scrollTop);
console.log(document.body.scrollTop);

}

print result away from the chrome console of the page (no matter how far you slide, the print result is the same every time, it is always 220):
the scrolling distance of Wechat on the ios side is normal.

however, execute directly in the chrome console: the
document.documentElement.scrollTop=1000
page scrolls normally.

does anyone know why? thank you in advance.

Mar.03,2021
Menu