Line data Source code
1 : <template>
2 564 : <div
3 : role="tablist"
4 : :class="cn('flex w-full items-center gap-2', customClass)"
5 : >
6 : <slot />
7 : </div>
8 : </template>
9 :
10 : <script setup lang="ts" generic="T extends string = string">
11 : import { provide } from 'vue'
12 :
13 : import { cn } from '@comfyorg/tailwind-utils'
14 :
15 : import { TAB_LIST_INJECTION_KEY } from './tabKeys'
16 :
17 : const { class: customClass = '' } = defineProps<{ class?: string }>()
18 :
19 316 : const modelValue = defineModel<T>({ required: true })
20 :
21 64 : function select(value: string) {
22 64 : modelValue.value = value as T
23 : }
24 :
25 316 : provide(TAB_LIST_INJECTION_KEY, {
26 : modelValue,
27 : select
28 : })
29 : </script>
|