mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-09-16 00:09:59 +08:00
fix: 修复一些问题
This commit is contained in:
parent
c28c353f7d
commit
34c20d4be7
@ -41,15 +41,16 @@ const throttleDirective: CustomDirectiveFC<
|
||||
|
||||
throttleFunction = throttle(func, wait, Object.assign({}, options))
|
||||
|
||||
useEventListener(el, trigger, throttleFunction)
|
||||
cleanup = useEventListener(el, trigger, throttleFunction)
|
||||
},
|
||||
beforeUnmount: () => {
|
||||
if (throttleFunction) {
|
||||
throttleFunction.cancel()
|
||||
cleanup?.()
|
||||
}
|
||||
|
||||
throttleFunction = null
|
||||
|
||||
cleanup?.()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user