dynamize projects
This commit is contained in:
parent
3f9c8bbebf
commit
edd9e66efb
10 changed files with 417 additions and 291 deletions
24
src/components/Projects.vue
Normal file
24
src/components/Projects.vue
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<template>
|
||||
<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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue