create projects store

This commit is contained in:
isUnknown 2024-09-10 08:49:09 +02:00
parent 18ac3b9173
commit 893d173c59
6 changed files with 360 additions and 106 deletions

12
src/stores/projects.js Normal file
View file

@ -0,0 +1,12 @@
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 };
});