mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
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:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user