diff --git a/src/components/MainMenu.vue b/src/components/MainMenu.vue index a1c3488..b5c7f27 100644 --- a/src/components/MainMenu.vue +++ b/src/components/MainMenu.vue @@ -1,9 +1,9 @@
@@ -20,6 +20,21 @@ 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; + } + }, + }, }; diff --git a/src/components/Menu2dCA.vue b/src/components/Menu2dCA.vue index 49b5cb0..58a410b 100644 --- a/src/components/Menu2dCA.vue +++ b/src/components/Menu2dCA.vue @@ -13,6 +13,11 @@ +