fix(components): [backtop] fix a display bug (#9892)

fix(components): fix a display bug

The component is not hidden when the scroll bar rolls to the top within 300 ms. Add [trailing=true]
attributes to the useThrottleFn() function,that call handleScroll again after the time is up, and
the bug is fixed.

BREAKING CHANGE :
no

closed no
This commit is contained in:
wenrun
2022-09-25 09:34:54 +08:00
committed by GitHub
parent 98fee90d90
commit 0088da111d

View File

@@ -66,7 +66,7 @@ const handleClick = (event: MouseEvent) => {
emit('click', event)
}
const handleScrollThrottled = useThrottleFn(handleScroll, 300)
const handleScrollThrottled = useThrottleFn(handleScroll, 300, true)
useEventListener(container, 'scroll', handleScrollThrottled)
onMounted(() => {