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.

41 lines
1.0 KiB
Plaintext

import { defineStore } from "pinia";
interface projectSetting {
headerSetting : headerSetting,
siderSetting : siderSetting,
}
interface headerSetting {
isShow: boolean,
}
interface siderSetting {
isShow: boolean,
}
export const useProjectStore = defineStore({
id: 'project-setting',
state:(): { projectSetting: projectSetting } => ({
projectSetting: {
headerSetting: {
isShow: true,
},
siderSetting: {
isShow: true,
}
}
}),
getters: {
getHeaderSetting() : headerSetting {
return this.projectSetting.headerSetting;
},
getSiderSetting() : siderSetting {
return this.projectSetting.siderSetting;
}
},
actions: {
setHeaderShow( show: boolean ){
this.projectSetting.headerSetting.isShow = show;
},
setSiderShow( show: boolean ){
this.projectSetting.siderSetting.isShow = show;
},
}
});