mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-24 04:06:39 +08:00
27 lines
538 B
JavaScript
27 lines
538 B
JavaScript
import {defineStore} from 'pinia';
|
|
import Storage from "good-storage";
|
|
|
|
export const useSidebarStore = defineStore('sidebar', {
|
|
state: () => {
|
|
return {
|
|
collapse: false
|
|
};
|
|
},
|
|
getters: {},
|
|
actions: {
|
|
handleCollapse() {
|
|
this.collapse = !this.collapse;
|
|
}
|
|
}
|
|
});
|
|
|
|
const MENU_STORE_KEY = "admin_menu_items"
|
|
|
|
export function getMenuItems() {
|
|
return Storage.get(MENU_STORE_KEY)
|
|
}
|
|
|
|
export function setMenuItems(items) {
|
|
return Storage.set(MENU_STORE_KEY, items)
|
|
}
|