1👍
✅
You should use a scoped slot like :
<template>
<div>
<slot :nslot="nslot" />
</div>
</template>
<script>
name: 'comp',
data() {
return {
nslot: 0
}
}
</script>
in parent :
<template>
<div>
<compt v-slot="{nslot}">
<button :slot="nslot">{{nslot}}</button>
<comp/>
</div>
</template>
<script>
name: 'comp'
</script>
Source:stackexchange.com