menu mobile

This commit is contained in:
Valentin
2024-10-18 18:44:03 +02:00
parent d5c5d81841
commit baa26f3c49
6 changed files with 168 additions and 12 deletions

View File

@@ -0,0 +1,18 @@
import { defineStore } from 'pinia';
export const useLayoutStore = defineStore('layout', {
state: () => ({
minDesktopWidth: 992,
isDesktop: Boolean,
isEtapeListRetracted: Boolean,
}),
actions: {
setupResizeListenner () {
this.isDesktop = window.innerWidth >= this.minDesktopWidth ? true : false;
window.addEventListener('resize', () => {
this.isDesktop = window.innerWidth >= this.minDesktopWidth ? true : false;
})
this.isEtapeListRetracted = this.isDesktop ? false : true;
},
},
})