Skip to content
loading...

re: Hands-on Vue.js for Beginners (Part 2) VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Is it possible in Vue.js to put event handling code just in one place(in js file), like we do in jquery. $("#btnSubmit").click(function(e){ alert(...
 

Hi Aniketnaik, well... In Vue as you probably know by now, we declare the listeners directly on the template using @click or @event and pass in the name of a method. It is possible to attach listeners using vanilla javascript by doing element.addEventListener and passing a function, but it depends on what you're trying to accomplish. Good luck

code of conduct - report abuse