What are Vue.js events

Posted by

Vue.js allows us to intercept any DOM event by using the v-on directive on an element.

If we want to do something when a click event happens in this element:

Syntax

<button @click="clickHandler"></button>

Types of Vue.js events that you can handle

  • submit
  • keyup
  • drag
  • scroll
  • error
  • abort
  • mouseover
  • mouseout
  • load etc.

Example

OutPut:

Before click

After click

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x