Open farnabaz opened 6 months ago
Does it work if you define the slot in defineComponent ? (ref)
<template>
<div>
<h1>Title</h1>
<p>
<slot />
</p>
</div>
</template>
<script lang="ts">
import { defineComponent, type SlotsType } from 'vue'
export default defineComponent({
name: 'TextDefine',
slots: Object as SlotsType<{
default: {}
}>,
props: {
title: {
type: String,
default: 'Title'
}
}
})
</script>
Just tried it and it works 👍
So for defineComponent
slots should be defined inside script?
Module does not retrieve slots when a component defines with
defineComponent
or anything beside<script setup lang="ts">
It is strange behavior because for these kinds of components
props
are fine, but slots are missing.@stafyniaksacha Do you have an idea about this issue?
For example, when we have this component:
The result will be:
But with:
The output is: