Skip to content

Commit

Permalink
fix: 修复顶部导航鼠标滚动回弹
Browse files Browse the repository at this point in the history
  • Loading branch information
hooray committed Mar 17, 2024
1 parent 04fa39c commit 107e820
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/layouts/components/Header/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ const menuRef = ref()
// 顶部模式鼠标滚动
function handlerMouserScroll(event: WheelEvent) {
menuRef.value.scrollBy({
left: (event.deltaY || event.detail) > 0 ? 50 : -50,
})
if (event.deltaY || event.detail !== 0) {
menuRef.value.scrollBy({
left: (event.deltaY || event.detail) > 0 ? 50 : -50,
})
}
}
</script>

Expand Down

0 comments on commit 107e820

Please sign in to comment.