[Vuejs]-Cannot render component inside component

3👍

Change the template code of collection_set.vue to

<template>
 <div>
    <p>test</p>
  <collectable />
</div>
</template>

the reason for error is that Component template should contain exactly one root element
Here we were trying to craete two root elements p and collectable

Now that I wrapped it within a parent div container, it works just fine.
Please try and let me know if it helps.

One suggestion is that always check into console of browser devtools to check what could be the issue. In this case, the console gave the exact error, also the code compilation failed with same error.

0👍

In Vue, each component must have only ONE root element, meaning you need to have a tag like <p> or <div> and inside it all your template.

Leave a comment