安装
npm install throttle-debounce --save
引入(哪里需要引哪里)
节流
import { throttle } from ‘throttle-debounce’;
const throttleFunc = throttle(1000, false, (num) => {
console.log('num:', num);
});
const throttleFunc = throttle(1000, (num) => {
console.log('num:', num);