Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
此throttle函数存储了最后一次触发事件时的参数arguments和context,导致如果后续不再触发此事件,那么上一次触发事件时的dom以及组件都无法被内存回收。
比如在vxe-table中,触发mouse-wheel后表格会被缓存,后面即使销毁了表格,其内存也无法被释放。当然因为mouse-wheel事件是注册在window上的,在空白区域再次滚动鼠标滚轮,内存就会得以释放,但是新的内容又会被缓存,再关闭另一个表格或者其他组件,内存同样无法被回收。