Home >Web Front-end >JS Tutorial >Detailed explanation of monitoring input input event oninput in .vue file

Detailed explanation of monitoring input input event oninput in .vue file

小云云
小云云Original
2018-05-17 11:06:548694browse

The .vue file is actually a component. I have written an article about it before, at the address: .vue file. Today, this article is about monitoring input value change events in the .vue file. The requirement is that in this page, when the value of input is changed, an event is called. The first thing that comes to mind is oninput. This article mainly shares with you the monitoring input event (oninput) in the .vue file, as a reference for everyone, I hope it can help you.

oninput event is triggered when the user inputs

Detailed explanation of monitoring input input event oninput in .vue file

But writing this in .vue has no effect:

Detailed explanation of monitoring input input event oninput in .vue file

<input type="text" id="cardsNum2" value="1" @oninput ="inputFunc">

Writing like this has no effect:

Detailed explanation of monitoring input input event oninput in .vue file

<input type="text" id="cardsNum2" value="1" v-on:oninput ="inputFunc">

Finally, writing like this works:

Detailed explanation of monitoring input input event oninput in .vue file

<input type="text" id="cardsNum2" value="1" v-on:input ="inputFunc">

Related recommendations:

Jquery real-time monitoring input value example

##jsjs monitoring input input box value real-time change example

Solution to the problem that JQuery cannot listen to the keyup event of input under ff_jquery

The above is the detailed content of Detailed explanation of monitoring input input event oninput in .vue file. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn