Clean code.

This commit is contained in:
yuanhau 2025-05-10 22:05:10 +08:00
parent bf357f1c84
commit 5d58016b1d
39 changed files with 481 additions and 381 deletions

View file

@ -1,22 +1,27 @@
<script setup lang="ts">
import type { ListboxContentProps } from 'reka-ui'
import { cn } from '@/lib/utils'
import { ListboxContent, useForwardProps } from 'reka-ui'
import { computed, type HTMLAttributes } from 'vue'
import type { ListboxContentProps } from "reka-ui";
import { cn } from "@/lib/utils";
import { ListboxContent, useForwardProps } from "reka-ui";
import { computed, type HTMLAttributes } from "vue";
const props = defineProps<ListboxContentProps & { class?: HTMLAttributes['class'] }>()
const props = defineProps<
ListboxContentProps & { class?: HTMLAttributes["class"] }
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props
const { class: _, ...delegated } = props;
return delegated
})
return delegated;
});
const forwarded = useForwardProps(delegatedProps)
const forwarded = useForwardProps(delegatedProps);
</script>
<template>
<ListboxContent v-bind="forwarded" :class="cn('max-h-[300px] overflow-y-auto overflow-x-hidden', props.class)">
<ListboxContent
v-bind="forwarded"
:class="cn('max-h-[300px] overflow-y-auto overflow-x-hidden', props.class)"
>
<div role="presentation">
<slot />
</div>