Reputation: 401
my just encountered difficulties when learning vue,
and I don't know how to implement it. I hope someone can help me!
First, I declare that my English is not good, but I try to express my problem completely.
The current project hopes to call the API after leaving the input box after entering the content in the input box, but I will only delay him by 0.4 seconds. I don't know how to change the code to call the API when I leave the input box. I found an onBlur event on the Internet, but I still don't know how to write it, because I am really new to vue
. I hope I can get your help. thank you.
Upvotes: 0
Views: 602
Reputation: 802
You only need to replace the @input
event with @blur
<el-input v-model="inputData" placeholder="Content" @blur="delayFetch" />
Upvotes: 2