• +91 9723535972
  • info@interviewmaterial.com

Vue JS Interview Questions and Answers

Question - How do you register directives locally?

Answer -

You can also register directives locally(apart from globally) using directives option in component as below,

directives: {
  focus: {
    // directive definition
    inserted: function (el) {
      el.focus()
    }
  }
}
Now you can use v-focus directive on any element as below,


Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners