perf: optimize ScrooX component.
This commit is contained in:
parent
76c3f0b64c
commit
fd08d25ccf
@ -37,7 +37,10 @@ const wrapper = ref(null)
|
|||||||
const isOverflow = ref(false)
|
const isOverflow = ref(false)
|
||||||
|
|
||||||
const refreshIsOverflow = debounce(() => {
|
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)
|
}, 200)
|
||||||
|
|
||||||
function handleMouseWheel(e) {
|
function handleMouseWheel(e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user