I'm using vue3
ComponentA.vue
<template>
<slot name="label"></slot>
<slot></slot>
</template>
Simply using a template will work.
<template>
<ComponentA>
<template #label>
label
</template >
<template #default>
content
</template >
</ComponentA>
</template>
Is there any way to extract two templates into a component? like
<template>
<ComponentA>
<ComponentB />
</ComponentA>
</template>
ComponentA is a component of a library, so I can't modify it.
This is not work. v-slot must be owned by a custom element.
ComponentB.vue
<template>
<template #label>
label
</template >
<template #default>
content
</template >
</template>