Anti-shake and throttling packaging method and system
A technology of encapsulating methods and functions, which is applied in the direction of program control devices, program control design, and other database retrievals. It can solve problems such as poor user experience, increase the burden on browsers, and affect performance, and achieve the effect of simple use
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0040] Use the packaged component in Vue, the specific implementation code is:
[0041]
[0042]
[0043] Among them, the specific implementation code of the function anti-shake debounce is:
[0044]
[0045]
[0046] The specific implementation code of Vue functional component package anti-shake is:
[0047]
[0048]
[0049] Function throttling (throttle): When the event is continuously triggered, it is guaranteed that the event processing function is called only once within a certain period of time. The popular explanation of throttling is like turning on water from a faucet. Once the valve is opened, the water will rush down. With the fine traditional virtues of thrift and thrift, we should turn down the faucet. Drop by drop within a time interval.
[0050] The specific implementation code of function throttle is:
[0051]
[0052]
[0053] Use start time startTime, current time curTime and delay time delay inside the throttling function to calcu...
Embodiment 2
[0058] Use it as a function:
[0059] (1) Write the function anti-shake and throttling to utils.js, the specific implementation code is:
[0060] Function anti-shake
[0061]
[0062]
[0063] function throttling
[0064]
[0065]
[0066] (2) Used in components, taking the input event as an example, the specific implementation code is:
[0067]
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


