-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
To make it work wit vue 3.4 and setup sugar syntax, i've updated the script as follow:
<script setup lang="ts">
import { computed, provide, ref, useSlots } from "vue";
const slots = useSlots();
const tabTitles = computed(
() =>
slots.default &&
(slots!.default()[0].children as any)!.map((t: any) => t.props.title)
);
const selectedTiltle = ref(tabTitles.value[0]);
provide("selectedTitle", selectedTiltle);
</script>
i didn't test it with named slots or other use cases, but it works in my project
hope this heps.
joaobb
Metadata
Metadata
Assignees
Labels
No labels