mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
fix: horizontal scrolling invalid when reload component (#642)
This commit is contained in:
@@ -7,11 +7,14 @@ const scrollListWrap = ref<HTMLElement>() as Ref<HTMLElement>
|
||||
// const showRightMask = ref<boolean>(false)
|
||||
const showScrollMask = ref<boolean>(true)
|
||||
|
||||
watch(() => settings.value.enableHorizontalScrolling, (newValue) => {
|
||||
if (newValue)
|
||||
scrollListWrap.value.addEventListener('wheel', handleMouseScroll)
|
||||
watch([() => settings.value.enableHorizontalScrolling, scrollListWrap], ([enableHorizontalScrolling, scrollListWrap]) => {
|
||||
if (!scrollListWrap)
|
||||
return
|
||||
|
||||
if (enableHorizontalScrolling)
|
||||
scrollListWrap.addEventListener('wheel', handleMouseScroll)
|
||||
else
|
||||
scrollListWrap.value.removeEventListener('wheel', handleMouseScroll)
|
||||
scrollListWrap.removeEventListener('wheel', handleMouseScroll)
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user