fix: scrolling wheel cannot horizontally scroll

This commit is contained in:
Hakadao
2023-01-29 03:28:11 +08:00
parent b44df2dddc
commit fd06a861d5

View File

@@ -5,7 +5,7 @@ const scrollListWrap = ref<HTMLElement>() as Ref<HTMLElement>
const showLeftMask = ref<boolean>(false)
const showRightMask = ref<boolean>(false)
window.onload = () => {
onMounted(() => {
scrollListWrap.value.addEventListener('scroll', () => {
if (scrollListWrap.value.scrollLeft > 0) {
showLeftMask.value = true
@@ -28,7 +28,7 @@ window.onload = () => {
event.preventDefault()
scrollListWrap.value.scrollLeft += event.deltaY
})
}
})
</script>
<template>