From 00a56473f1228cd972711dac2347f33911b15f6b Mon Sep 17 00:00:00 2001 From: Yer <17633066053@163.com> Date: Wed, 9 Aug 2023 15:32:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20:bug:=20=E4=BC=98=E5=8C=96=E4=B9=B0?= =?UTF-8?q?=E5=AE=B6=E7=AB=AF=E9=A6=96=E9=A1=B5=E7=82=B9=E5=87=BB=E5=9B=9E?= =?UTF-8?q?=E5=88=B0=E9=A1=B6=E9=83=A8=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer/src/components/fixed/index.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/buyer/src/components/fixed/index.vue b/buyer/src/components/fixed/index.vue index be9422ce..72997f25 100644 --- a/buyer/src/components/fixed/index.vue +++ b/buyer/src/components/fixed/index.vue @@ -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; } });