menu mobile
This commit is contained in:
18
web/themes/custom/caravane/assets/js/stores/layout.js
Normal file
18
web/themes/custom/caravane/assets/js/stores/layout.js
Normal 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;
|
||||
},
|
||||
},
|
||||
})
|
Reference in New Issue
Block a user