mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-09-16 16:38:03 +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))
|
throttleFunction = throttle(func, wait, Object.assign({}, options))
|
||||||
|
|
||||||
useEventListener(el, trigger, throttleFunction)
|
cleanup = useEventListener(el, trigger, throttleFunction)
|
||||||
},
|
},
|
||||||
beforeUnmount: () => {
|
beforeUnmount: () => {
|
||||||
if (throttleFunction) {
|
if (throttleFunction) {
|
||||||
throttleFunction.cancel()
|
throttleFunction.cancel()
|
||||||
cleanup?.()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throttleFunction = null
|
throttleFunction = null
|
||||||
|
|
||||||
|
cleanup?.()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user