salix-front/src/stores/useArrayDataStore.js

20 lines
348 B
JavaScript
Raw Normal View History

2023-01-05 13:57:47 +00:00
import { ref } from 'vue';
import { defineStore } from 'pinia';
export const useArrayDataStore = defineStore('arrayDataStore', () => {
const store = ref({});
function get(key) {
return store.value[key];
}
function set(key, data) {
store.value[key] = data;
}
return {
get,
set,
};
});