记录,防止使用的时候爬坑
export const scrollToTop = () => {
const currentScroll =
document.documentElement.scrollTop || document.body.scrollTop;
if (currentScroll > 0) {
window.requestAnimationFrame(scrollToTop);
window.scrollTo(0, currentScroll - currentScroll / 8);
}
};