parent
1d518c2826
commit
28485eaf61
@ -32,7 +32,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
scrollContainer.value = getScrollContainer(refSticky.value!, true)
|
scrollContainer.value = getScrollContainer(refSticky.value!, true)
|
||||||
useEventListener(scrollContainer, 'scroll', handleScroll)
|
useEventListener(scrollContainer, 'scroll', handleScroll)
|
||||||
useEventListener('resize', handleReize)
|
useEventListener('resize', handleResize)
|
||||||
handleScroll()
|
handleScroll()
|
||||||
})
|
})
|
||||||
onActivated(() => {
|
onActivated(() => {
|
||||||
@ -103,7 +103,7 @@ const handleScroll = () => {
|
|||||||
reset()
|
reset()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const handleReize = () => {
|
const handleResize = () => {
|
||||||
if (isSticky.value && refSticky.value) {
|
if (isSticky.value && refSticky.value) {
|
||||||
width.value = refSticky.value.getBoundingClientRect().width + 'px'
|
width.value = refSticky.value.getBoundingClientRect().width + 'px'
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user