31 lines
879 B
Vue
31 lines
879 B
Vue
<script setup>
|
|
import { reactiveOmit } from "@vueuse/core";
|
|
import { ScrollAreaCorner, ScrollAreaRoot, ScrollAreaViewport } from "reka-ui";
|
|
import { cn } from "@/lib/utils";
|
|
import ScrollBar from "./ScrollBar.vue";
|
|
|
|
const props = defineProps({
|
|
type: { type: String, required: false },
|
|
dir: { type: String, required: false },
|
|
scrollHideDelay: { type: Number, required: false },
|
|
asChild: { type: Boolean, required: false },
|
|
as: { type: null, required: false },
|
|
class: { type: null, required: false },
|
|
});
|
|
|
|
const delegatedProps = reactiveOmit(props, "class");
|
|
</script>
|
|
|
|
<template>
|
|
<ScrollAreaRoot
|
|
v-bind="delegatedProps"
|
|
:class="cn('relative overflow-hidden', props.class)"
|
|
>
|
|
<ScrollAreaViewport class="h-full w-full rounded-[inherit]">
|
|
<slot />
|
|
</ScrollAreaViewport>
|
|
<ScrollBar />
|
|
<ScrollAreaCorner />
|
|
</ScrollAreaRoot>
|
|
</template>
|