redesign tabs

This commit is contained in:
isUnknown 2024-09-10 09:12:52 +02:00
parent 893d173c59
commit 0075a37ab2
4 changed files with 52 additions and 38 deletions

View file

@ -1,8 +1,16 @@
<template>
<h2 id="tabslist" class="sr-only">Projets</h2>
<template v-if="projects.children">
<Tabs :projects="projects.children" @update:currentTab="changeTab" />
<TabPanel :projects="projects.children" :currentTab="currentTab" />
<template v-if="projects.length > 0">
<Tabs
:currentProjects="currentProjects"
:archivedProjects="archivedProjects"
@update:currentTab="changeTab"
/>
<TabPanel
:currentProjects="currentProjects"
:archivedProjects="archivedProjects"
:currentTab="currentTab"
/>
</template>
</template>
<script setup>
@ -12,9 +20,11 @@ import { useProjectsStore } from "../stores/projects";
import { ref } from "vue";
import { storeToRefs } from "pinia";
const { projects } = storeToRefs(useProjectsStore());
const { projects, currentProjects, archivedProjects } = storeToRefs(
useProjectsStore()
);
const currentTab = ref("current");
const currentTab = ref("currentProjects");
function changeTab(newValue) {
currentTab.value = newValue;