redesign tabs
This commit is contained in:
parent
893d173c59
commit
0075a37ab2
4 changed files with 52 additions and 38 deletions
|
|
@ -1,12 +1,21 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { useApiStore } from "./api.js";
|
||||
import { ref } from "vue";
|
||||
import { ref, computed } from "vue";
|
||||
|
||||
export const useProjectsStore = defineStore("projects", () => {
|
||||
const projects = ref([]);
|
||||
|
||||
const api = useApiStore();
|
||||
api.fetchPageData("projects").then((json) => (projects.value = json));
|
||||
const currentProjects = computed(() => {
|
||||
return projects.value.filter((project) => project.status === "listed");
|
||||
});
|
||||
const archivedProjects = computed(() => {
|
||||
return projects.value.filter((project) => project.status === "unlisted");
|
||||
});
|
||||
|
||||
return { projects };
|
||||
const api = useApiStore();
|
||||
api
|
||||
.fetchPageData("projects")
|
||||
.then((json) => (projects.value = json.children));
|
||||
|
||||
return { projects, currentProjects, archivedProjects };
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue