41 lines
850 B
JavaScript
41 lines
850 B
JavaScript
// /src/stores/uiStore.js
|
|
import { defineStore } from 'pinia';
|
|
import { ref } from 'vue';
|
|
|
|
export const useUiStore = defineStore('ui', () => {
|
|
const isSidebarOpen = ref(true);
|
|
const isMobileSidebarOpen = ref(false);
|
|
const breadcrumbs = ref([]);
|
|
|
|
function toggleSidebar() {
|
|
isSidebarOpen.value = !isSidebarOpen.value;
|
|
}
|
|
|
|
function toggleMobileSidebar() {
|
|
isMobileSidebarOpen.value = !isMobileSidebarOpen.value;
|
|
}
|
|
|
|
function closeMobileSidebar() {
|
|
isMobileSidebarOpen.value = false;
|
|
}
|
|
|
|
function openMobileSidebar() {
|
|
isMobileSidebarOpen.value = true;
|
|
}
|
|
|
|
function setBreadcrumbs(items) {
|
|
breadcrumbs.value = items;
|
|
}
|
|
|
|
return {
|
|
isSidebarOpen,
|
|
isMobileSidebarOpen,
|
|
breadcrumbs,
|
|
toggleSidebar,
|
|
toggleMobileSidebar,
|
|
closeMobileSidebar,
|
|
openMobileSidebar,
|
|
setBreadcrumbs
|
|
};
|
|
});
|