import { defineStore } from 'pinia'; import { getStoreList } from '@/api/common'; import * as storeUtil from '@/utils/storeUtil'; export const useStorageStore = defineStore('storage', { state: () => ({ list: [], activedId: storeUtil.getId() || '' }), actions: { async fetchListData() { const res = await getStoreList({ // lat: '23.13', // lng: '113.26' lat: '0', lng: '0' }) this.list = res.data || []; }, updateActivedId(storageId) { storeUtil.setId(storageId); this.activedId = storageId; } } })