designtopack/src/App.vue

18 lines
370 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-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-07-10 16:10:33 +02:00
2024-07-11 12:42:29 +02:00
const components = {
home,
2024-07-10 18:43:46 +02:00
};
2024-07-10 16:10:33 +02:00
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>