feat: add useCrudSchemas hook

This commit is contained in:
陈凯龙
2022-04-26 15:03:48 +08:00
parent ab0f59ac91
commit 00d947e2f8
11 changed files with 468 additions and 162 deletions

38
src/store/modules/dict.ts Normal file
View File

@@ -0,0 +1,38 @@
import { defineStore } from 'pinia'
import { store } from '../index'
export interface DictState {
isSetDict: boolean
dictObj: Recordable
}
export const useDictStore = defineStore({
id: 'dict',
state: (): DictState => ({
isSetDict: false,
dictObj: {}
}),
persist: {
enabled: true
},
getters: {
getDictObj(): Recordable {
return this.dictObj
},
getIsSetDict(): boolean {
return this.isSetDict
}
},
actions: {
setDictObj(dictObj: Recordable) {
this.dictObj = dictObj
},
setIsSetDict(isSetDict: boolean) {
this.isSetDict = isSetDict
}
}
})
export const useDictStoreWithOut = () => {
return useDictStore(store)
}