• +91 9723535972
  • info@interviewmaterial.com

Vue JS Interview Questions and Answers

Question - Give an example to demonstrate how can you use event handlers?

Answer -

Event handlers are used in Vue.js are similar to plain JavaScript. The method calls also support the special $event variable.

Example:

  Submit  
  
methods: {  
  show: function (message, event) {  
    // now we have access to the native event  
    if (event) event.preventDefault()  
    console.log(message);  
  }  
}   

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners