designtopack/src/components/Projects.vue

35 lines
841 B
Vue
Raw Normal View History

2024-09-04 11:28:12 +02:00
<template>
<h2 id="tabslist" class="sr-only">Projets</h2>
2024-09-10 09:12:52 +02:00
<template v-if="projects.length > 0">
<Tabs
:currentProjects="currentProjects"
:archivedProjects="archivedProjects"
@update:currentTab="changeTab"
/>
<TabPanel
:currentProjects="currentProjects"
:archivedProjects="archivedProjects"
:currentTab="currentTab"
/>
2024-09-04 11:28:12 +02:00
</template>
</template>
<script setup>
import Tabs from "./Tabs.vue";
import TabPanel from "./TabPanel.vue";
2024-09-10 08:49:09 +02:00
import { useProjectsStore } from "../stores/projects";
2024-09-04 11:28:12 +02:00
import { ref } from "vue";
2024-09-10 08:49:09 +02:00
import { storeToRefs } from "pinia";
2024-09-04 11:28:12 +02:00
2024-09-10 09:12:52 +02:00
const { projects, currentProjects, archivedProjects } = storeToRefs(
useProjectsStore()
);
2024-09-04 11:28:12 +02:00
2024-09-10 09:12:52 +02:00
const currentTab = ref("currentProjects");
2024-09-04 11:28:12 +02:00
function changeTab(newValue) {
currentTab.value = newValue;
}
</script>
<style scoped></style>