page is simple, just an input box
<input type="text" v-model="keyword" @keyup="search($event)">
js:
methods:{
//
search:function(e){
var timer;
if(e.keyCode != 32){ //
clearTimeout(timer);
timer = setTimeout(()=>{
console.log("");
}, 1000)
}
}
}
when I typed "123", I printed it three times
what I want:
when I typed "123", I printed it once