fix: 🐛 优化买家端首页点击回到顶部的判断

This commit is contained in:
Yer
2023-08-09 15:32:44 +08:00
parent e138275c0a
commit 00a56473f1

View File

@@ -45,11 +45,13 @@ export default {
}
},
mounted() {
const vm = this
// 添加滚轮事件监听器
window.addEventListener('wheel', function() {
if (this.isScrolling) {
if (vm.isScrolling) {
// 如果页面正在滚动,则取消定时器并设置 isScrolling 为 false
window.cancelAnimationFrame(this.timeoutId);
window.cancelAnimationFrame(vm.timeoutId);
vm.isScrolling = false;
}
});