1、使用lodash(throttle --节流,debounce—防抖),按需引入
import throttle from 'lodash/throttle';
2、方法里函数不能使用箭头函数(每两秒出发一次)
changeIndex:throttle(function(index){
this.currentindex = index;
},2000),
1、使用lodash(throttle --节流,debounce—防抖),按需引入
import throttle from 'lodash/throttle';
2、方法里函数不能使用箭头函数(每两秒出发一次)
changeIndex:throttle(function(index){
this.currentindex = index;
},2000),