28 lines
		
	
	
		
			601 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			601 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { useStorage } from "@vueuse/core";
 | |
| import { defineStore } from "pinia";
 | |
| 
 | |
| interface State {
 | |
|     Menu: MenuSettings
 | |
| }
 | |
| 
 | |
| interface MenuSettings {
 | |
|     Show: boolean | null,
 | |
|     Expand: boolean | null,
 | |
| }
 | |
| 
 | |
| export const useSettingsStore = defineStore('settings', {
 | |
|     state: () => ({
 | |
|         Menu: useStorage<MenuSettings>('settings', {
 | |
|             Show: null,
 | |
|             Expand: false,
 | |
|         }),
 | |
|     }),
 | |
|     actions: {
 | |
|         toggleMenu() {
 | |
|             this.Menu.Show = !this.Menu.Show;
 | |
|         },
 | |
|         toggleMenuSize() {
 | |
|             this.Menu.Expand = !this.Menu.Expand;
 | |
|         },
 | |
|     }
 | |
| }); |