Files
portal/resources/js/components/App.vue
2020-04-04 09:21:08 +02:00

35 lines
760 B
Vue

<template>
<div class="flex">
<Nav />
<div>
<TopBar />
<main>
<router-view :key="$route.fullPath" class="main"></router-view>
</main>
</div>
</div>
</template>
<script>
import Nav from "./Nav";
import TopBar from "./TopBar";
export default {
name: "App",
components : {
Nav, TopBar
},
mounted() {
this.$store.dispatch('fetchAuthUser')
},
created() {
this.$store.dispatch('setPageTitle', this.$route.meta.title)
},
watch: {
$route(to, from) {
this.$store.dispatch('setPageTitle', to.meta.title)
}
}
}
</script>