一:安装

npm install throttle-debounce --save

二: 使用 (throttle-debounce)

throttle :节流

import { throttle } from "throttle-debounce"

       throttleCallback: throttle(1000, false, () => {
            //业务
        }),

debounce :防抖

import { debounce } from "throttle-debounce"

       debounceCallback: debounce(1000, false, () => {
           //业务
        }),

Logo

前往低代码交流专区

更多推荐