Home > Web Front-end > JS Tutorial > body text

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

小云云
Release: 2018-05-17 11:06:54
Original
8661 people have browsed it

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">
Copy after login

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">
Copy after login

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">
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!