angular10中使用lodash的throttle方法
时间:2021-09-15 20:45:09
收藏:0
阅读:51
先引入lodash
import * as _ from ‘ lodash ‘
public search = _.throttle(function(){
这里写自己的函数
}, 3000, {
leading: true,
trailing: false,
})
_.throttle 他本身需要返回一个函数,用他来处理节流
原文:https://www.cnblogs.com/rrene/p/15268040.html
评论(0)