Skip to content
Advertisement

Awaiting till user finishes writing to input field in Vue.js

I have a QR code creating page. I want my QR codes to be created dynamically by user input. But I don’t want to instantly create a QR code. I want to wait my user to finish writing then after one second i will generate the QR code. So I have a template like below:

JavaScript

And my script:

JavaScript

Apparently the code is not working. It generated the QR code every one seconds. What I want is waiting till user finished, then updating after 1 seconds.

Advertisement

Answer

You have to use .lazy modifier :

JavaScript

If you want to wait some delay try this :

JavaScript

This is based on this answer;

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement