mirror of
https://github.com/Lissy93/dashy.git
synced 2026-01-24 00:31:50 +01:00
Add watcher to handle dynamic section changes in SideBar component
Co-authored-by: JDB321Sailor <212125521+JDB321Sailor@users.noreply.github.com>
This commit is contained in:
parent
4bde34c3b1
commit
075970b293
1 changed files with 11 additions and 0 deletions
|
|
@ -59,6 +59,17 @@ export default {
|
|||
});
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
/* Update isOpen array when filtered sections change */
|
||||
filteredSections(newSections) {
|
||||
// Resize isOpen array if needed
|
||||
const currentLength = this.isOpen.length;
|
||||
const newLength = newSections.length;
|
||||
if (newLength !== currentLength) {
|
||||
this.isOpen = new Array(newLength).fill(false);
|
||||
}
|
||||
},
|
||||
},
|
||||
components: {
|
||||
SideBarItem,
|
||||
SideBarSection,
|
||||
|
|
|
|||
Loading…
Reference in a new issue