First step from vuex to pinia
This commit is contained in:
21
web/src/stores/settings.ts
Normal file
21
web/src/stores/settings.ts
Normal 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;
|
||||
},
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user