vue添加防斗
<Input style="width:200px" @on-change="saveAll" />
export default {
data(){
return{
timer: null, // 用于临时存放计时器
}
},
methods: {
saveAll () {
if (this.timer) {
clearTimeout(this.timer);
}
this.timer = setTimeout(() => {
console.log("7895641536")
}, 1000)
}
}
}
本文来自博客园,作者:小万子呀,转载请注明原文链接:https://www.cnblogs.com/newBugs/p/15660849.html

浙公网安备 33010602011771号