mirror of
https://github.com/haexhub/haex-hub.git
synced 2025-12-17 06:30:50 +01:00
Add context menu for vault actions and trash functionality
- Add UiButtonContext component for context menu support on buttons - Implement vault trash functionality using trash crate - Move vaults to system trash on desktop (with fallback to permanent delete on mobile) - Add context menu to vault list items for better mobile UX - Keep hover delete button for desktop users
This commit is contained in:
28
src/components/ui/button/context.vue
Normal file
28
src/components/ui/button/context.vue
Normal file
@ -0,0 +1,28 @@
|
||||
<template>
|
||||
<UContextMenu :items="contextMenuItems">
|
||||
<UiButton
|
||||
v-bind="$attrs"
|
||||
@click="$emit('click', $event)"
|
||||
>
|
||||
<template
|
||||
v-for="(_, slotName) in $slots"
|
||||
#[slotName]="slotProps"
|
||||
>
|
||||
<slot
|
||||
:name="slotName"
|
||||
v-bind="slotProps"
|
||||
/>
|
||||
</template>
|
||||
</UiButton>
|
||||
</UContextMenu>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { ContextMenuItem } from '@nuxt/ui'
|
||||
|
||||
defineProps<{
|
||||
contextMenuItems: ContextMenuItem[]
|
||||
}>()
|
||||
|
||||
defineEmits<{ click: [Event] }>()
|
||||
</script>
|
||||
Reference in New Issue
Block a user