Event Handling

How to add Event listeners in Vue.js?

  • The v-on directive is used to attach the event listeners to the dom elements.
  • Vue offers us a property called methods.
  • Inside the methods property, we need to declare the event handler functions.

Example