20 lines
380 B
Vue
20 lines
380 B
Vue
<script setup lang="ts">
|
|
import { inject, useAttrs } from "vue";
|
|
import { badgeContextKey } from "./context";
|
|
|
|
defineOptions({ inheritAttrs: false });
|
|
|
|
const attrs = useAttrs();
|
|
const ctx = inject(badgeContextKey, undefined);
|
|
</script>
|
|
|
|
<template>
|
|
<span
|
|
v-bind="attrs"
|
|
:class="ctx?.slots.value.label()"
|
|
data-slot="badge-label"
|
|
>
|
|
<slot />
|
|
</span>
|
|
</template>
|