harb/web-app/src/App.vue

33 lines
698 B
Vue
Raw Normal View History

2025-09-23 14:18:04 +02:00
<template>
<component :is="layoutComponent">
<RouterView />
</component>
2025-09-23 14:18:04 +02:00
</template>
<script setup lang="ts">
import { RouterView, useRoute } from 'vue-router';
2025-09-23 14:18:04 +02:00
import type { LayoutName } from '@/types/router';
import DefaultLayout from '@/layouts/DefaultLayout.vue';
import NavbarLayout from '@/layouts/NavbarLayout.vue';
const layouts = {
DefaultLayout,
NavbarLayout,
2025-09-23 14:18:04 +02:00
};
import { computed } from 'vue';
2025-09-23 14:18:04 +02:00
const route = useRoute();
const layoutComponent = computed(() => {
const layoutName: LayoutName = route.meta.layout ?? 'DefaultLayout';
return layouts[layoutName]; // Jetzt kennt TypeScript den Typ!
});
</script>
<style lang="sass">
footer
margin-top: auto
</style>