fix: change attribute inheritance element

This commit is contained in:
sadeghbarati 2024-01-08 10:03:16 +03:30
parent 13c47ce50b
commit 40f07479e1
2 changed files with 10 additions and 0 deletions

View File

@ -3,6 +3,10 @@ import type { WithClassAsProps } from './interface'
import { useCarousel } from './useCarousel' import { useCarousel } from './useCarousel'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
defineOptions({
inheritAttrs: false,
})
const props = defineProps<WithClassAsProps>() const props = defineProps<WithClassAsProps>()
const { carouselRef, orientation } = useCarousel() const { carouselRef, orientation } = useCarousel()
@ -17,6 +21,7 @@ const { carouselRef, orientation } = useCarousel()
orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',
props.class, props.class,
)" )"
v-bind="$attrs"
> >
<slot /> <slot />
</div> </div>

View File

@ -3,6 +3,10 @@ import { useCarousel } from './useCarousel'
import type { WithClassAsProps } from './interface' import type { WithClassAsProps } from './interface'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
defineOptions({
inheritAttrs: false,
})
const props = defineProps<WithClassAsProps>() const props = defineProps<WithClassAsProps>()
const { carouselRef, orientation } = useCarousel() const { carouselRef, orientation } = useCarousel()
@ -17,6 +21,7 @@ const { carouselRef, orientation } = useCarousel()
orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',
props.class, props.class,
)" )"
v-bind="$attrs"
> >
<slot /> <slot />
</div> </div>