23 lines
498 B
JavaScript
23 lines
498 B
JavaScript
import { defineStore } from 'pinia'
|
|
import { ref } from 'vue'
|
|
|
|
export const useUiStore = defineStore('ui', () => {
|
|
const loading = ref(false)
|
|
const loadingText = ref('')
|
|
const sidebarCollapsed = ref(false)
|
|
|
|
function setLoading(visible, text = '') {
|
|
loading.value = visible
|
|
loadingText.value = text
|
|
}
|
|
|
|
function toggleSidebar() {
|
|
sidebarCollapsed.value = !sidebarCollapsed.value
|
|
}
|
|
|
|
return {
|
|
loading, loadingText, sidebarCollapsed,
|
|
setLoading, toggleSidebar
|
|
}
|
|
})
|