Files
fe.ems.vue3/src/store/modules/core.ts
T

32 lines
622 B
TypeScript

import { defineStore } from 'pinia';
/**核心网信息类型 */
type Core = {
/**当前选择 */
current: string;
/**核心网选择 */
coreOptions: Record<string, any>[];
};
const useCoreStore = defineStore('core', {
state: (): Core => ({
current: 'Global',
coreOptions: [
{ label: 'Core', value: 'Core' },
{ label: 'Core2', value: 'Core2' },
],
}),
getters: {
getCoreOptions(): Record<string, any>[] {
return this.coreOptions;
},
},
actions: {
setCurrent(value: string = 'Global') {
this.current = value;
},
},
});
export default useCoreStore;