You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
396 B
TypeScript
20 lines
396 B
TypeScript
2 years ago
|
import { defineStore } from 'pinia'
|
||
|
|
||
|
interface AppState {
|
||
|
siderCollapsed: boolean
|
||
|
}
|
||
|
|
||
|
export const useAppStore = defineStore('app-store', {
|
||
|
state: (): AppState => ({
|
||
|
siderCollapsed: false,
|
||
|
}),
|
||
|
actions: {
|
||
|
setSiderCollapsed(collapsed: boolean) {
|
||
|
this.siderCollapsed = collapsed
|
||
|
},
|
||
|
toggleSiderCollapse() {
|
||
|
this.siderCollapsed = !this.siderCollapsed
|
||
|
},
|
||
|
},
|
||
|
})
|