Collapse all submenus if the main menu gets collapsed

This commit is contained in:
Johannes Zellner
2025-12-16 12:49:39 +01:00
parent 6b7e8bef1d
commit 5e485fb87e
+7 -2
View File
@@ -1,6 +1,6 @@
<script setup>
import { ref, computed, useTemplateRef } from 'vue';
import { ref, computed, useTemplateRef, watch } from 'vue';
import { Menu } from '@cloudron/pankow';
import SideBarItem from './SideBarItem.vue';
@@ -38,6 +38,12 @@ const props = defineProps({
}
});
const isExpanded = ref(false);
watch(() => props.collapsed, () => {
isExpanded.value = false;
});
const isActive = computed(() => {
const active = props.active;
return typeof active === 'function' ? active() : active ?? true;
@@ -48,7 +54,6 @@ const isVisible = computed(() => {
return typeof visible === 'function' ? visible() : visible ?? true;
});
const isExpanded = ref(false);
function close() {
emit('close');