fix: fix
This commit is contained in:
parent
2f7da255e5
commit
4a5b8dd005
@ -38,16 +38,16 @@ const wrapper = ref(null)
|
|||||||
const isOverflow = ref(false)
|
const isOverflow = ref(false)
|
||||||
|
|
||||||
const refreshIsOverflow = debounce(() => {
|
const refreshIsOverflow = debounce(() => {
|
||||||
const wrapperWidth = wrapper.value.offsetWidth
|
const wrapperWidth = wrapper.value?.offsetWidth
|
||||||
const contentWidth = content.value.offsetWidth
|
const contentWidth = content.value?.offsetWidth
|
||||||
isOverflow.value = contentWidth > wrapperWidth
|
isOverflow.value = contentWidth > wrapperWidth
|
||||||
resetTranslateX(wrapperWidth, contentWidth)
|
resetTranslateX(wrapperWidth, contentWidth)
|
||||||
}, 200)
|
}, 200)
|
||||||
|
|
||||||
function handleMouseWheel(e) {
|
function handleMouseWheel(e) {
|
||||||
const { wheelDelta } = e
|
const { wheelDelta } = e
|
||||||
const wrapperWidth = wrapper.value.offsetWidth
|
const wrapperWidth = wrapper.value?.offsetWidth
|
||||||
const contentWidth = content.value.offsetWidth
|
const contentWidth = content.value?.offsetWidth
|
||||||
/**
|
/**
|
||||||
* @wheelDelta 平行滚动的值 >0: 右移 <0: 左移
|
* @wheelDelta 平行滚动的值 >0: 右移 <0: 左移
|
||||||
* @translateX 内容translateX的值
|
* @translateX 内容translateX的值
|
||||||
|
Loading…
Reference in New Issue
Block a user