localhost-front/src/App.vue

20 lines
490 B
Vue

<template>
<component :is="layout">
<template #content>
<router-view></router-view>
</template>
</component>
</template>
<script setup>
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import NormalLayout from './layouts/NormalLayout.vue';
import NoLayout from './layouts/NoLayout.vue';
const route = useRoute();
const layout = computed(() => {
return route.meta.layout === 'NoLayout' ? NoLayout : NormalLayout;
});
</script>