designtopack/src/App.vue

29 lines
726 B
Vue
Raw Normal View History

2024-07-11 12:42:29 +02:00
<template>
<component :is="components[data.template]" v-if="data" :data="data" />
</template>
2024-07-10 18:43:46 +02:00
<script setup>
import { useApiStore } from "./stores/api";
2024-09-10 12:09:53 +02:00
import { useUserStore } from "./stores/user";
2024-07-11 12:42:29 +02:00
import { ref } from "vue";
2024-07-11 14:38:06 +02:00
import home from "./views/Home.vue";
2024-09-12 19:07:49 +02:00
import notifications from "./views/Notifications.vue";
import reunions from "./views/Reunions.vue";
import inspirations from "./views/Inspirations.vue";
2024-09-10 12:09:53 +02:00
import { storeToRefs } from "pinia";
2024-07-10 16:10:33 +02:00
2024-07-11 12:42:29 +02:00
const components = {
2024-09-10 12:09:53 +02:00
home,
2024-09-12 19:07:49 +02:00
notifications,
reunions,
inspirations
2024-07-10 18:43:46 +02:00
};
2024-07-10 16:10:33 +02:00
2024-09-10 12:09:53 +02:00
const { user } = storeToRefs(useUserStore());
user.value = kirbyData.user;
2024-07-11 12:42:29 +02:00
const data = ref(null);
2024-07-10 18:43:46 +02:00
const api = useApiStore();
2024-07-11 12:42:29 +02:00
api.fetchPageData().then((res) => (data.value = res));
2024-07-10 16:10:33 +02:00
</script>