mirror of
https://github.com/keven1024/015.git
synced 2026-06-05 03:49:36 +00:00
29 lines
921 B
Vue
29 lines
921 B
Vue
<script setup lang="ts">
|
|
import type { MenubarTriggerProps } from 'reka-ui'
|
|
import type { HTMLAttributes } from 'vue'
|
|
import { reactiveOmit } from '@vueuse/core'
|
|
import { MenubarTrigger, useForwardProps } from 'reka-ui'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
const props = defineProps<MenubarTriggerProps & { class?: HTMLAttributes['class'] }>()
|
|
|
|
const delegatedProps = reactiveOmit(props, 'class')
|
|
|
|
const forwardedProps = useForwardProps(delegatedProps)
|
|
</script>
|
|
|
|
<template>
|
|
<MenubarTrigger
|
|
data-slot="menubar-trigger"
|
|
v-bind="forwardedProps"
|
|
:class="
|
|
cn(
|
|
'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none',
|
|
props.class
|
|
)
|
|
"
|
|
>
|
|
<slot />
|
|
</MenubarTrigger>
|
|
</template>
|