From 9b83b88c549240fae76ae9199a616d16753bae75 Mon Sep 17 00:00:00 2001 From: Gator Date: Sat, 10 Dec 2022 10:45:34 +0100 Subject: [PATCH 1/2] submenu closes when click outside --- src/components/MainMenu.vue | 24 +++------------ src/components/MenuCellProperties.vue | 2 +- src/components/MenuRow.vue | 42 +++++++++++++++++++++------ src/stores/index.js | 8 +++++ 4 files changed, 46 insertions(+), 30 deletions(-) diff --git a/src/components/MainMenu.vue b/src/components/MainMenu.vue index b5c7f27..53a65bc 100644 --- a/src/components/MainMenu.vue +++ b/src/components/MainMenu.vue @@ -1,9 +1,9 @@ @@ -20,21 +20,6 @@ MenuElementaryCA, Menu2dCA, }, - data() { - return { - active: "", - }; - }, - methods: { - // set the opened submenu. If already active, reset it so it can close - updateActive(menu) { - if (menu === this.active) { - this.active = ""; - } else { - this.active = menu; - } - }, - }, }; @@ -43,7 +28,6 @@ display: flex; flex-direction: row; width: 100%; - flex: 1; } diff --git a/src/components/MenuCellProperties.vue b/src/components/MenuCellProperties.vue index 49b07f9..33a4786 100644 --- a/src/components/MenuCellProperties.vue +++ b/src/components/MenuCellProperties.vue @@ -38,7 +38,7 @@ import { globalStore } from "../stores/index.js"; import MenuRow from "./MenuRow.vue"; export default { - name: "MainMenu", + name: "MenuCellProperties", components: { MenuRow, }, diff --git a/src/components/MenuRow.vue b/src/components/MenuRow.vue index 4db98db..4db663c 100644 --- a/src/components/MenuRow.vue +++ b/src/components/MenuRow.vue @@ -1,15 +1,17 @@