调整版本树使用的数据结构和后端一致
This commit is contained in:
@@ -7,3 +7,4 @@ store.use(createPersistedState())
|
||||
export default store
|
||||
export * from './global'
|
||||
export * from './userInfo'
|
||||
export * from './projectData'
|
||||
|
||||
20
src/stores/projectData.ts
Normal file
20
src/stores/projectData.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref, computed } from 'vue'
|
||||
export const useProjectStore = defineStore('project', () => {
|
||||
const state = ref({// 项目参数
|
||||
id: '',
|
||||
})
|
||||
|
||||
const setProject = (obj: any) => {
|
||||
for (const key in obj) {
|
||||
if(state.value[key]){
|
||||
state.value[key] = obj[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
state,
|
||||
setProject,
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user