Moved Sidebar to top of app

This prevents flicker and stops useless rerender of the component
This commit is contained in:
Alexis
2024-06-07 19:35:49 +02:00
parent ad79ca4186
commit 4a4433dcdd
8 changed files with 35 additions and 77 deletions

14
stores/UiStore.ts Normal file
View File

@@ -0,0 +1,14 @@
import type { SidebarMenuItem } from "~/components/global/sidebar/SidebarProps"
export const useUiStore = defineStore('ui', () => {
const currentMenu: Ref<SidebarMenuItem[]> = ref<SidebarMenuItem[]>([])
function setCurrentMenu(items: SidebarMenuItem[]) {
currentMenu.value = items
}
return {
currentMenu,
setCurrentMenu
}
})