feat: 预设 pinia 相关文件
This commit is contained in:
19
src/store/modules/app/index.ts
Normal file
19
src/store/modules/app/index.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
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
|
||||
},
|
||||
},
|
||||
})
|
||||
12
src/store/modules/history/index.ts
Normal file
12
src/store/modules/history/index.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
interface HistoryState {
|
||||
list: any[]
|
||||
}
|
||||
|
||||
export const useHistoryStore = defineStore('history-store', {
|
||||
state: (): HistoryState => ({
|
||||
list: [],
|
||||
}),
|
||||
actions: {},
|
||||
})
|
||||
2
src/store/modules/index.ts
Normal file
2
src/store/modules/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './app'
|
||||
export * from './history'
|
||||
Reference in New Issue
Block a user