|
1 | 1 | <script setup lang="ts">
|
2 |
| -import { cn } from '@/lib/utils'; |
3 |
| -import { ChevronDown } from 'lucide-vue-next'; |
4 |
| -import { NavigationMenuTrigger, useForwardProps, type NavigationMenuTriggerProps } from 'radix-vue'; |
5 |
| -import { computed, type HTMLAttributes } from 'vue'; |
6 |
| -import { navigationMenuTriggerStyle } from '.'; |
| 2 | +import { cn } from '@/lib/utils' |
| 3 | +import { ChevronDown } from 'lucide-vue-next' |
| 4 | +import { |
| 5 | + NavigationMenuTrigger, |
| 6 | + type NavigationMenuTriggerProps, |
| 7 | + useForwardProps, |
| 8 | +} from 'radix-vue' |
| 9 | +import { computed, type HTMLAttributes } from 'vue' |
| 10 | +import { navigationMenuTriggerStyle } from '.' |
7 | 11 |
|
8 |
| -const props = defineProps<NavigationMenuTriggerProps & { class?: HTMLAttributes['class'] }>(); |
| 12 | +const props = defineProps<NavigationMenuTriggerProps & { class?: HTMLAttributes['class'] }>() |
9 | 13 |
|
10 | 14 | const delegatedProps = computed(() => {
|
11 |
| - const { class: _, ...delegated } = props; |
| 15 | + const { class: _, ...delegated } = props |
12 | 16 |
|
13 |
| - return delegated; |
14 |
| -}); |
| 17 | + return delegated |
| 18 | +}) |
15 | 19 |
|
16 |
| -const forwardedProps = useForwardProps(delegatedProps); |
| 20 | +const forwardedProps = useForwardProps(delegatedProps) |
17 | 21 | </script>
|
18 | 22 |
|
19 | 23 | <template>
|
20 |
| - <NavigationMenuTrigger v-bind="forwardedProps" :class="cn(navigationMenuTriggerStyle(), 'group', props.class)"> |
21 |
| - <slot /> |
22 |
| - <ChevronDown class="relative top-px ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180" aria-hidden="true" /> |
23 |
| - </NavigationMenuTrigger> |
| 24 | + <NavigationMenuTrigger |
| 25 | + v-bind="forwardedProps" |
| 26 | + :class="cn(navigationMenuTriggerStyle(), 'group', props.class)" |
| 27 | + > |
| 28 | + <slot /> |
| 29 | + <ChevronDown |
| 30 | + class="relative top-px ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180" |
| 31 | + aria-hidden="true" |
| 32 | + /> |
| 33 | + </NavigationMenuTrigger> |
24 | 34 | </template>
|
0 commit comments