29 lines
1000 B
Vue
29 lines
1000 B
Vue
<script setup lang="ts">
|
|
import { DropdownMenuContent, DropdownMenuPortal, DropdownMenuRoot, DropdownMenuTrigger } from 'reka-ui';
|
|
|
|
/**
|
|
* Replaces the PrimeVue popup Menu, whose imperative `menu.toggle($event)` call
|
|
* required a template ref on every caller. Reka wires the trigger up itself, so
|
|
* a caller only supplies the trigger element and the items.
|
|
*/
|
|
withDefaults(defineProps<{ align?: 'start' | 'center' | 'end' }>(), { align: 'end' });
|
|
</script>
|
|
|
|
<template>
|
|
<DropdownMenuRoot>
|
|
<DropdownMenuTrigger as-child>
|
|
<slot name="trigger" />
|
|
</DropdownMenuTrigger>
|
|
|
|
<DropdownMenuPortal>
|
|
<DropdownMenuContent
|
|
:align="align"
|
|
:side-offset="6"
|
|
class="z-50 min-w-48 overflow-hidden rounded-md border border-slate-200 bg-white py-1 shadow-lg focus:outline-none"
|
|
>
|
|
<slot />
|
|
</DropdownMenuContent>
|
|
</DropdownMenuPortal>
|
|
</DropdownMenuRoot>
|
|
</template>
|