In my parent component, I have a grid container and a child component:
<template>
<div>
<div class="container">
<grid-items></grid-items>
<grid-items></grid-items>
<grid-items></grid-items>
</div>
</div>
</template>
The child component contains grid items:
<template>
<div>
<div class="item">FOO</div>
<div class="item">BAR</div>
</div>
</template>
It doesn't work because I have to surround the grid-items with an extra root div in the child component, breaking the grid logic. If I remove this surrounding div in the child component, I get the following compilation error message:
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.
How can I fix this CSS grid logic issue?