PluginProbe
The Innovative Form Builder – IvyForms / 0.9.1
The Innovative Form Builder – IvyForms v0.9.1
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / frontend / src / views / admin / testing / testing-page / TestingContextMenu.vue

TestingContextMenu.vue in The Innovative Form Builder – IvyForms 0.9.1, at frontend/src/views/admin/testing/testing-page/TestingContextMenu.vue

62 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <template>
2 <h3>Menu Props Controls</h3>
3 <div class="menu-controls">
4 <label>
5 Priority:
6 <select>
7 <!-- <select v-model="priority">-->
8 <option value="primary">Primary</option>
9 <option value="secondary">Secondary</option>
10 </select>
11 </label>
12
13 <label>
14 Style:
15 <select>
16 <!-- <select v-model="style">-->
17 <option value="fill">Fill</option>
18 <option value="ghost">Ghost</option>
19 </select>
20 </label>
21 </div>
22
23 <h3>Menu Component Preview</h3>
24 <div class="menu-preview">
25 <IvyButtonAction ref="menuButtonRef" @click="openMenu">Open Context Menu</IvyButtonAction>
26 <IvyContextMenu />
27 </div>
28 </template>
29
30 <script setup lang="ts">
31 import { ref } from 'vue'
32 import { useContextMenuStore } from '@/stores/contextMenuStore.ts'
33 import {
34 createContextMenuAction,
35 ContextMenuActionType,
36 } from '@/views/_components/context-menu/kit/ContextMenuActionType'
37 const contextMenuStore = useContextMenuStore()
38 const menuButtonRef = ref(null)
39
40 const actions = [
41 createContextMenuAction(ContextMenuActionType.Edit),
42 createContextMenuAction(ContextMenuActionType.Delete, {
43 handler: () => console.log('Custom delete handler'),
44 }),
45 createContextMenuAction(ContextMenuActionType.Duplicate),
46 ]
47
48 const openMenu = () => {
49 contextMenuStore.openContextMenu({
50 actions: actions,
51 contextMenuButtonRef: menuButtonRef.value,
52 })
53 }
54 </script>
55
56 <style lang="scss">
57 .menu-preview {
58 width: 600px;
59 align-items: center;
60 }
61 </style>
62