This commit is contained in:
2026-05-11 00:32:03 +08:00
parent 2535bec2ed
commit 10022ae048
32 changed files with 2450 additions and 203 deletions
@@ -0,0 +1,35 @@
<script lang="ts">
export const tabsContextKey = Symbol("tabs") as InjectionKey<TabsContextValue>;
</script>
<script setup lang="ts">
import { provide } from "vue";
import type { InjectionKey, Ref } from "vue";
import { cn } from "@/lib/utils";
export interface TabsContextValue {
modelValue: Ref<string>;
setValue: (value: string) => void;
}
const props = defineProps<{
class?: string;
}>();
const modelValue = defineModel<string>({ required: true });
const setValue = (value: string) => {
modelValue.value = value;
};
provide(tabsContextKey, {
modelValue,
setValue,
});
</script>
<template>
<div data-slot="tabs" :class="cn('flex flex-col gap-3', props.class)">
<slot />
</div>
</template>