(1)_.debounce(()=>{},时间):防抖;
search: _.debounce(function () {
this.searchInfo.page = 1;
this.getTableData();
}, 200),
(2)_.throttle(()=>{},时间):节流;
clear: _.thorttle(function () {
Object.keys(this.searchInfo).forEach(key => {
if (key != "page" && key != "pageSize") {
this.searchInfo[key] = "";
}
})
this.cityPartnerNameList = [];
this.searchInfo.page = 1;
this.getTableData();
}, 200),
(3)_.cloneDeep(obj):深拷贝,返回一个拷贝后的值;
this.newAddressDataList = _.cloneDeep(this.addressDataList);
(4)_.merge(obj1,obj2):合并对象,返回一个合并后的新的对象;
this.newObj= _.merge(this.obj1,this.obj2);