Skip to content

Commit 216ac32

Browse files
committed
fix: 修复顶部导航鼠标滚动回弹
1 parent 537d010 commit 216ac32

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/views/components/Header/index.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ const menuRef = ref()
1717
1818
// 顶部模式鼠标滚动
1919
function handlerMouserScroll(event: WheelEvent) {
20-
menuRef.value.scrollBy({
21-
left: (event.deltaY || event.detail) > 0 ? 50 : -50,
22-
})
20+
if (event.deltaY || event.detail !== 0) {
21+
menuRef.value.scrollBy({
22+
left: (event.deltaY || event.detail) > 0 ? 50 : -50,
23+
})
24+
}
2325
}
2426
</script>
2527

0 commit comments

Comments
 (0)