• +91 9723535972
  • info@interviewmaterial.com

Vue JS Interview Questions and Answers

Question - When the components need a single root element?

Answer -

In Vue.js 2.x version, 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, it will show an error, saying that "Component template should contain exactly one root element,"

The Vue.js 3.x version facilitates that the 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