lodash.debounce | Lodash 中文文档 | Lodash 中文网
Lodash 是一个一致性、模块化、高性能的 JavaScript 实用工具库。
//npm 安装 :$ npm i --save lodash
//为减少项目体积在Vue项目中按需求引入
//例如节流函数引入 - > Vue文件中
//引入loadsh - 节流函数
import throttle from 'lodash/throttle';
//函数节流
activeIndex:throttle(function(i){
this.current = i;
console.log(this.current+'curr')
},60)
//其他函数引入方式相同