Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is $event.target.value a javascript command or a vue.js command?

I have this line in my vue.js application

<input type="text" v-on:input="cssClass=$event.target.value">

I know that in javascript I can get event.target.value. I think that the above code is Vue.js specific code, but I'm not sure. Need confirmation.

like image 565
Simon Suh Avatar asked Nov 22 '25 08:11

Simon Suh


1 Answers

v-on:input will consume the actual DOM event of the input initially, store against $event, a special variable, and then make it available to the function being called. In this case you access $event.target.value to get the newly input value from the event. Methods in Inline Handlers

Hope that helps.

like image 81
Searching Avatar answered Nov 24 '25 22:11

Searching



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!