<template>
    <div>
        <Nav />
        <div class="flex">
            <SideBar />
            <router-view class="main"></router-view>
        </div>
    </div>
</template>

<script>
    import Nav from "./Nav";
    import SideBar from "./SideBar";

    export default {
        name: "App",
        components : {
            Nav, SideBar
        },
        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>
