designtopack/src/components/Projects.vue

26 lines
658 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-04 11:28:12 +02:00
<template v-if="data">
<Tabs :projects="data.children" @update:currentTab="changeTab" />
<TabPanel :projects="data.children" :currentTab="currentTab" />
</template>
</template>
<script setup>
import Tabs from "./Tabs.vue";
import TabPanel from "./TabPanel.vue";
import { useApiStore } from "../stores/api";
import { ref } from "vue";
const data = ref(null);
const currentTab = ref("current");
const api = useApiStore();
api.fetchPageData("projects").then((res) => (data.value = res));
function changeTab(newValue) {
currentTab.value = newValue;
}
</script>
<style scoped></style>