create projects store
This commit is contained in:
parent
18ac3b9173
commit
893d173c59
6 changed files with 360 additions and 106 deletions
12
src/stores/projects.js
Normal file
12
src/stores/projects.js
Normal 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 };
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue