From 7ea03c30f5c5dfd90be55cc3125be4ebfee1da95 Mon Sep 17 00:00:00 2001 From: Paul Vilalta Date: Mon, 22 Aug 2022 11:11:23 +0200 Subject: [PATCH] add action property to first nested menu --- .../BIMDataDropdownMenu/BIMDataDropdownMenu.vue | 1 + src/web/views/Components/DropdownMenu/DropdownMenu.vue | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/BIMDataComponents/BIMDataDropdownMenu/BIMDataDropdownMenu.vue b/src/BIMDataComponents/BIMDataDropdownMenu/BIMDataDropdownMenu.vue index 20912a71..f98529e3 100644 --- a/src/BIMDataComponents/BIMDataDropdownMenu/BIMDataDropdownMenu.vue +++ b/src/BIMDataComponents/BIMDataDropdownMenu/BIMDataDropdownMenu.vue @@ -22,6 +22,7 @@ v-for="item in menuItems" :key="item.name" class="bimdata-dropdown__elements__menu-items__item" + @click="item.action && item.action()" @mouseover="handleCurrentItem(item.name)" @mouseleave="handleCurrentItem()" > diff --git a/src/web/views/Components/DropdownMenu/DropdownMenu.vue b/src/web/views/Components/DropdownMenu/DropdownMenu.vue index 6b42f752..92a651e9 100644 --- a/src/web/views/Components/DropdownMenu/DropdownMenu.vue +++ b/src/web/views/Components/DropdownMenu/DropdownMenu.vue @@ -158,13 +158,13 @@ export default { { name: "project1.3" }, ], }, - { name: "project2" }, + { name: "project2", action: () => console.log("I'm clicked") }, { name: "project3", children: [ { name: "project3.1", - action: () => console.log("im clicked"), + action: () => console.log("I'm clicked"), }, { name: "project3.2" }, ],