zterton-status/src/App.vue

37 lines
1.0 KiB
Vue
Raw Normal View History

2021-10-14 14:42:52 +00:00
<template>
2021-10-19 20:43:23 +00:00
<component :is="layout" class="text-gray-700 dark:text-gray-200">
2021-10-14 14:42:52 +00:00
<router-view />
</component>
</template>
<script setup lang="ts">
// <Footer />
import { computed } from 'vue'
import { useRouter } from 'vue-router'
2021-10-19 20:43:23 +00:00
import { useStore } from 'vuex'
import { AppDefsAction } from '~/store/types'
2021-10-14 14:42:52 +00:00
// import AppLayout from '~/layouts/AppLayout.vue'
import { useHead } from '@vueuse/head'
// https://github.com/vueuse/head
// you can use this to manipulate the document head in any components,
// they will be rendered correctly in the html results with vite-ssg
2021-10-19 20:43:23 +00:00
import defs from '../assets/defs.json'
const store = useStore()
2021-10-14 14:42:52 +00:00
useHead({
title: 'Status',
meta: [
{ name: 'description', content: 'Opinionated Vite Starter Template' },
],
})
const { currentRoute } = useRouter()
const appLayout = 'AppLayout'
const layout = computed(() => {
return `${currentRoute.value.meta.layout || appLayout}`
})
2021-10-19 20:43:23 +00:00
onBeforeMount(() => {
if (defs) {
store.dispatch(AppDefsAction.addDefs, { key: 'ui', defs })
}
})
2021-10-14 14:42:52 +00:00
</script>