2👍
✅
You can do this with by using slots as shown below
Layout Component:
<template>
<div>
<!-- the slot is where we will put the content -->
<slot name = 'content'/>
</div>
</template>
export default{
name: "Layout"
}
Usage:
<template>
<Layout>
<!-- we now use the slot here by passing the name of the slot to the template below and putting the content inside-->
<template #content>
<div class='mycontent'>content</div>
</template>
</Layout>
</template>
export default{
name: "SomethingElse"
}
Source:stackexchange.com