2021-01-16 00:54:31 +08:00
|
|
|
<template>
|
|
|
|
<component :is="layout">
|
2021-01-22 03:38:17 +08:00
|
|
|
<!-- <div class="text-center">Flash Messages will come here.</div> -->
|
2021-01-16 00:54:31 +08:00
|
|
|
<router-view />
|
|
|
|
</component>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-12-01 06:11:13 +08:00
|
|
|
import { defineComponent, computed } from 'vue';
|
|
|
|
import { useRouter } from 'vue-router';
|
|
|
|
const defaultLayout = 'default';
|
2021-04-09 06:37:58 +08:00
|
|
|
|
2021-12-01 06:11:13 +08:00
|
|
|
export default defineComponent({
|
|
|
|
setup() {
|
|
|
|
const { currentRoute } = useRouter();
|
2021-10-23 18:51:28 +08:00
|
|
|
|
2021-12-01 06:11:13 +08:00
|
|
|
const layout = computed(() => `${currentRoute.value.meta.layout || defaultLayout}-layout`);
|
2021-04-09 06:37:58 +08:00
|
|
|
|
2021-12-01 06:11:13 +08:00
|
|
|
return {
|
|
|
|
layout,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
});
|
2021-01-16 00:54:31 +08:00
|
|
|
</script>
|