shadcn-vue/packages/module/playground/components/ui/carousel/CarouselContent.vue
zernonia 7a7cf9d05d
fix: Nuxt module throwing error due to parsing error (#267)
* chore: add carousel

* chore: add oxc-parser

* feat: use oxc-parser to get ExportNamedDeclaration node

* chore: add todo
2024-01-12 10:18:30 +08:00

30 lines
600 B
Vue

<script setup lang="ts">
import type { WithClassAsProps } from './interface'
import { useCarousel } from './useCarousel'
import { cn } from '@/lib/utils'
defineOptions({
inheritAttrs: false,
})
const props = defineProps<WithClassAsProps>()
const { carouselRef, orientation } = useCarousel()
</script>
<template>
<div ref="carouselRef" class="overflow-hidden">
<div
:class="
cn(
'flex',
orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',
props.class,
)"
v-bind="$attrs"
>
<slot />
</div>
</div>
</template>