Open fncheng opened 2 years ago
methods: { getSearchResult() { debounce(function() { console.log(this.searchValue); })(); } }
发现传递的参数无论怎样也无法触发。
这其实是错误的使用方式
正确的使用方式应该是这样的:
onSave: throttle(function() { // 表单验证 this.$refs['ruleForm'].validate(valid => { console.log('this: ', this) if (valid) { this.submitForm() } else return false }) }, 1000, { leading: true }),
Vue中使用节流
发现传递的参数无论怎样也无法触发。
这其实是错误的使用方式
正确的使用方式应该是这样的: