我正在Vue中尝试使用类似的东西:
props(){
debouncing: {type: Number, default: 0}
},
methods: {
clicked: _.debounce(function() {
this.$emit('click');
}, this.debouncing),
}
但是,例如当设置为debouncing = 4000
答案 0 :(得分:0)
感谢@RoyJ的评论:
computed:{
clicked(){
return _.debounce(this.click, this.debouncing)
}
},
methods:{
click(){
this.$emit('click');
},
}