Skip to content

Commit

Permalink
Merge pull request #1247 from PrefectHQ/fix-tabs
Browse files Browse the repository at this point in the history
Fix tabs not showing content when slots are used
  • Loading branch information
pleek91 authored Apr 25, 2024
2 parents 2bfb642 + 82a4749 commit 06120f4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/Tabs/PTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<section class="p-tabs">
<template v-if="media.sm">
<PTabNavigation v-model:selected="selected" class="p-tabs--not-mobile" :tabs="tabs">
<template v-for="tab in tabs" #[`${tab}-heading`]="data">
<slot :name="`${tab}-heading`" v-bind="data" />
<template v-for="tab in tabs" #[`${kebabCase(tab.label)}-heading`]="data">
<slot :name="`${kebabCase(tab.label)}-heading`" v-bind="data" />
</template>

<template #heading="data">
Expand All @@ -13,8 +13,8 @@
</template>
<template v-else>
<PTabSelect v-model:selected="selected" :tabs="tabs">
<template v-for="tab in tabs" #[`${tab}-heading`]="data">
<slot :name="`${tab}-heading`" v-bind="data" />
<template v-for="tab in tabs" #[`${kebabCase(tab.label)}-heading`]="data">
<slot :name="`${kebabCase(tab.label)}-heading`" v-bind="data" />
</template>

<template #heading="data">
Expand All @@ -30,7 +30,7 @@
role="tabpanel"
:aria-labelledby="`${kebabCase(tab.label)}`"
>
<slot :name="`${tab.label}`" v-bind="{ tab, index }">
<slot :name="`${kebabCase(tab.label)}`" v-bind="{ tab, index }">
<slot name="content" v-bind="{ tab, index }" />
</slot>
</section>
Expand Down

0 comments on commit 06120f4

Please sign in to comment.