mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-07-26 16:24:39 +00:00
14 lines
381 B
TypeScript
14 lines
381 B
TypeScript
import { defineStore } from 'pinia'
|
|
import type { AppState } from './helper'
|
|
import { getLocalSetting, setLocalSetting } from './helper'
|
|
|
|
export const useAppStore = defineStore('app-store', {
|
|
state: (): AppState => getLocalSetting(),
|
|
actions: {
|
|
setSiderCollapsed(collapsed: boolean) {
|
|
this.siderCollapsed = collapsed
|
|
setLocalSetting(this.$state)
|
|
},
|
|
},
|
|
})
|