Migration to nuxt 4

Used codemods CLI and reworked most alias'd path that stopped working
This commit is contained in:
Alexis
2025-07-27 14:30:30 +02:00
parent 68b9a38f83
commit 7fdab8601f
280 changed files with 847 additions and 496 deletions

51
app/stores/UiStore.ts Normal file
View File

@@ -0,0 +1,51 @@
import { breakpointsTailwind } from "@vueuse/core"
import type { SidebarMenuItem } from "~/components/global/sidebar/SidebarProps"
const breakpoints = useBreakpoints(
breakpointsTailwind
)
export const useUiStore = defineStore("ui", () => {
const currentMenu = ref<SidebarMenuItem[]>([])
const isSidebarOpened = ref<boolean>(false)
function setCurrentMenu(items: SidebarMenuItem[]) {
currentMenu.value = items
}
function resetMenu() {
currentMenu.value = []
}
function openSidebar() {
if (breakpoints.isGreater("md")) return
isSidebarOpened.value = true
}
function closeSidebar() {
if (breakpoints.isGreater("md")) return
isSidebarOpened.value = false
}
function toggleSidebar() {
if (breakpoints.isGreater("md")) return
isSidebarOpened.value = !isSidebarOpened.value
}
watch(breakpoints.md, () => {
isSidebarOpened.value = false
})
return {
currentMenu,
setCurrentMenu,
resetMenu,
isSidebarOpened,
openSidebar,
closeSidebar,
toggleSidebar
}
})