Answer the question
In order to leave comments, you need to log in
How to add multiple components inside a Vue component?
There is a component, let's say it's called Home.vue, it contains the following code:
<template>
<banner></banner>
<services></services>
</template>
(Emitted value instead of an instance of Error)
Error compiling template:
<banner></banner>
<services></services>
- Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.
Answer the question
In order to leave comments, you need to log in
Wrap everything in a div
<template>
<div>
<banner></banner>
<services></services>
</div>
</template>
should contain exactly one root element
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question