The New Way to Build with AI! Introducing ReUI — the developer platform for agentic UI with shadcn/ui
Browse ReUI Pro

VueJS Template : Component template should contain exactly one root element.

I get the following error all over the VueJS demo1

Component template should contain exactly one root element.

Looking at your Vue Templates in crafted pages. Almost all of them have multiple root elements. Why is this?

Any example is crafted/account/Settings.vue. It has 5 root elements inside of the template

<template>
<div class="card mb-5 mb-xl-10">>
  </div>

<div class="card mb-5 mb-xl-10">>
  </div>

<div class="card mb-5 mb-xl-10">>
  </div>

<div class="card mb-5 mb-xl-10">>
  </div>

<div class="card mb-5 mb-xl-10">>
  </div>
</template>
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (4)

 
Deleted comment

Metronic Latest basing it off Demo1 for VueJS



In Vue 2, a component could only contain one root element, but in Vue 3, components can contain multiple root elements.

You can check Vue 3 migration guide:



Hi,

Could you please specify which product are you using?



My formatting is messed up. See Below


<template>
<div class="card mb-5 mb-xl-10">>
</div>

<div class="card mb-5 mb-xl-10">>
</div>

<div class="card mb-5 mb-xl-10">>
</div>

<div class="card mb-5 mb-xl-10">>
</div>

<div class="card mb-5 mb-xl-10">>
</div>
</template>


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
buy metronic keenthemes mega bundle

ReUI

Open-source React components, blocks and templates built on shadcn/ui and Tailwind CSS by Keenthemes.