<template>
  <component :is="components[data.template]" v-if="data" :data="data" />
</template>

<script setup>
import home from "./views/Home.vue";
import { useApiStore } from "./stores/api";
import { ref } from "vue";

const components = {
  home,
};

const data = ref(null);
const api = useApiStore();
api.fetchPageData().then((res) => (data.value = res));
</script>
