felicity-lims/frontend/vite/src/App.vue

24 lines
564 B
Vue
Raw Normal View History

2021-01-16 00:54:31 +08:00
<template>
<component :is="layout">
<!-- <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-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>