Many fix and improvements
This commit is contained in:
23
src/stores/sideBarStore.js
Normal file
23
src/stores/sideBarStore.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import {computed, ref} from 'vue';
|
||||
import {defineStore} from "pinia";
|
||||
|
||||
export const useSideBarStore = defineStore(
|
||||
'sideBar',
|
||||
() => {
|
||||
const state = ref(false)
|
||||
const visible = computed(() => state.value)
|
||||
|
||||
function toggle() {
|
||||
state.value = !state.value
|
||||
}
|
||||
|
||||
function show() {
|
||||
state.value = true
|
||||
}
|
||||
|
||||
function hide() {
|
||||
state.value = false
|
||||
}
|
||||
|
||||
return {visible, toggle, show, hide}
|
||||
})
|
||||
Reference in New Issue
Block a user