First step from vuex to pinia

This commit is contained in:
2022-02-09 23:08:36 +00:00
parent 2137460187
commit 2d0737a10c
8 changed files with 147 additions and 86 deletions

View File

@@ -0,0 +1,21 @@
import { defineStore } from "pinia";
interface State {
ShowMenu?: boolean,
ExpandMenu?: boolean,
}
export const useSettingsStore = defineStore('settings', {
state: (): State => ({
ShowMenu: undefined,
ExpandMenu: false,
}),
actions: {
toggleMenu() {
this.ShowMenu = !this.ShowMenu;
},
toggleMenuSize() {
this.ExpandMenu = !this.ExpandMenu;
},
}
});