Here's a demo of the Unwrap component in the Vue SFC Playground (Vue 3).
Conditionally unwrap the contained components.
<template>
<div>
<label>
<input type="checkbox" v-model="singleList" />
Single list
</label>
<Unwrap :if="!singleList">
<ul>
<Unwrap :if="singleList">
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
<ul>
<li>4</li>
<li>5</li>
<li>6</li>
</ul>
</Unwrap>
</ul>
</Unwrap>
</div>
</template>
<script>
import Unwrap from './unwrap.js'
export default {
components: { Unwrap },
data: () => ({
singleList: false
})
}
</script>