35 lines
667 B
Vue
35 lines
667 B
Vue
<script lang="ts">
|
|
import { computed } from 'vue';
|
|
import { useRoute } from 'vue-router';
|
|
import AuthLayout from './layout/AuthLayout.vue';
|
|
import MainLayout from './layout/MainLayout.vue';
|
|
|
|
export default {
|
|
components: {
|
|
AuthLayout,
|
|
MainLayout,
|
|
},
|
|
setup() {
|
|
const route = useRoute();
|
|
const layout = computed(() => route.meta.layout);
|
|
const layoutProps = computed(() => route.meta.layoutProps);
|
|
|
|
return {
|
|
layout,
|
|
layoutProps,
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<component
|
|
:is="layout + '-layout'"
|
|
v-if="layout"
|
|
v-bind="layoutProps"
|
|
/>
|
|
</template>
|
|
|
|
<style scoped>
|
|
</style>
|