diff --git a/src/components/common/ScrollX.vue b/src/components/common/ScrollX.vue index c0c823e..1161fc7 100644 --- a/src/components/common/ScrollX.vue +++ b/src/components/common/ScrollX.vue @@ -37,7 +37,10 @@ const wrapper = ref(null) const isOverflow = ref(false) const refreshIsOverflow = debounce(() => { - isOverflow.value = content.value.offsetWidth > wrapper.value.offsetWidth + const wrapperWidth = wrapper.value.offsetWidth + const contentWidth = content.value.offsetWidth + isOverflow.value = contentWidth > wrapperWidth + resetTranslateX(wrapperWidth, contentWidth) }, 200) function handleMouseWheel(e) {