fix(Chip): proxy attrs to slot

Resolves nuxt/ui#2484
This commit is contained in:
Benjamin Canac
2024-10-31 12:17:51 +01:00
parent b416a194df
commit 8669553ea4

View File

@@ -41,9 +41,11 @@ export interface ChipSlots {
<script setup lang="ts"> <script setup lang="ts">
import { computed } from 'vue' import { computed } from 'vue'
import { Primitive } from 'radix-vue' import { Primitive, Slot } from 'radix-vue'
import { useAvatarGroup } from '../composables/useAvatarGroup' import { useAvatarGroup } from '../composables/useAvatarGroup'
defineOptions({ inheritAttrs: false })
const props = withDefaults(defineProps<ChipProps>(), { const props = withDefaults(defineProps<ChipProps>(), {
inset: false, inset: false,
standalone: false standalone: false
@@ -65,7 +67,9 @@ const ui = computed(() => chip({
<template> <template>
<Primitive :as="as" :class="ui.root({ class: [props.class, props.ui?.root] })"> <Primitive :as="as" :class="ui.root({ class: [props.class, props.ui?.root] })">
<slot /> <Slot v-bind="$attrs">
<slot />
</Slot>
<span v-if="show" :class="ui.base({ class: props.ui?.base })"> <span v-if="show" :class="ui.base({ class: props.ui?.base })">
<slot name="content"> <slot name="content">