designtopack/src/stores/projects.js

13 lines
328 B
JavaScript
Raw Normal View History

2024-09-10 08:49:09 +02:00
import { defineStore } from "pinia";
import { useApiStore } from "./api.js";
import { ref } from "vue";
export const useProjectsStore = defineStore("projects", () => {
const projects = ref([]);
const api = useApiStore();
api.fetchPageData("projects").then((json) => (projects.value = json));
return { projects };
});