• +91 9723535972
  • info@interviewmaterial.com

Vue JS Interview Questions and Answers

Question - When component needs a single root element?

Answer -

In VueJS 2.x, every component must have a single root element when template has more than one element. In this case, you need to wrap the elements with a parent element.

Otherwise there will an error throwing, saying that "Component template should contain exactly one root element...".

Whereas in 3.x, components now can have multiple root nodes. This way of adding multiple root nodes is called as fragments.


Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners