<input type="text" @input="reach" name="" id="" placeholder="请输入">
data() {
return {
time: null
}
},
methods: {
getData() {
console.log('被触发了');
},
reach() {
clearTimeout(this.time)
this.time = setTimeout(() => {
this.getData()
}, 500)
},
}