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

```

>

>

>

>

>

```

Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (4)

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>

Hi,

Could you please specify which product are you using?

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:
https://v3-migration.vuejs.org/breaking-changes/functional-components.html#functional-components

Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(