zhangwencui
3 天以前 a2002ba0e8aa2a0e4eee61b5205748d8f6e454fc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<script setup lang="ts">
import type { AccordionItemProps } from 'reka-ui';
 
import type { HTMLAttributes } from 'vue';
 
import { cn } from '../../../../../base/shared/src/utils';
 
import { reactiveOmit } from '@vueuse/core';
import { AccordionItem, useForwardProps } from 'reka-ui';
 
const props = defineProps<
  AccordionItemProps & { class?: HTMLAttributes['class'] }
>();
 
const delegatedProps = reactiveOmit(props, 'class');
 
const forwardedProps = useForwardProps(delegatedProps);
</script>
 
<template>
  <AccordionItem
    v-slot="slotProps"
    data-slot="accordion-item"
    v-bind="forwardedProps"
    :class="cn('border-b last:border-b-0', props.class)"
  >
    <slot v-bind="slotProps"></slot>
  </AccordionItem>
</template>