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