Started implementation of profile / employee-form

This commit is contained in:
Sockenklaus
2021-10-27 01:27:06 +02:00
parent a65d01c36d
commit 6cb1f6b488
6 changed files with 239 additions and 20 deletions

View File

@@ -0,0 +1,36 @@
<script setup lang="ts">
import { useRouter } from 'vue-router';
import { useUser } from '@/stores/user';
const userStore = useUser()
const router = useRouter()
async function onLogout() {
if(await userStore.logout()){
router.push({name: 'Login'})
}
}
</script>
<template>
<nav class="nav justify-content-center border-bottom mb-4 pb-2 d-flex">
<router-link class="nav-link" to="/">Home</router-link>
<div class="ms-auto"></div>
<router-link
v-if="userStore.isLoggedIn"
class="nav-link"
:to="{name: 'Profile'}"
>
Profile
</router-link>
<a v-if="userStore.isLoggedIn" href="#" @click="onLogout()" class="nav-link">Logout</a>
<router-link v-else to="Login" class="nav-link">Login</router-link>
</nav>
</template>
<style scoped>
</style>