mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 15:13:30 +00:00
31 lines
1.1 KiB
Vue
31 lines
1.1 KiB
Vue
<script setup lang="ts">
|
|
import type { MenubarSubTriggerProps } from 'reka-ui'
|
|
import type { HTMLAttributes } from 'vue'
|
|
import { reactiveOmit } from '@vueuse/core'
|
|
import { ChevronRight } from '@lucide/vue'
|
|
import { MenubarSubTrigger, useForwardProps } from 'reka-ui'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
const props = defineProps<MenubarSubTriggerProps & { class?: HTMLAttributes['class']; inset?: boolean }>()
|
|
|
|
const delegatedProps = reactiveOmit(props, 'class', 'inset')
|
|
const forwardedProps = useForwardProps(delegatedProps)
|
|
</script>
|
|
|
|
<template>
|
|
<MenubarSubTrigger
|
|
data-slot="menubar-sub-trigger"
|
|
:data-inset="inset ? '' : undefined"
|
|
v-bind="forwardedProps"
|
|
:class="
|
|
cn(
|
|
'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8',
|
|
props.class
|
|
)
|
|
"
|
|
>
|
|
<slot />
|
|
<ChevronRight class="ml-auto size-4" />
|
|
</MenubarSubTrigger>
|
|
</template>
|