42 lines
1.1 KiB
Vue
42 lines
1.1 KiB
Vue
<template>
|
|
<v-app-bar fixed app color="primary" dark>
|
|
<v-btn to="/" text rounded>Simple Notes</v-btn>
|
|
<v-spacer />
|
|
<v-menu bottom left>
|
|
<template v-slot:activator="{ on }">
|
|
<v-btn aria-label="menu" icon v-on="on">
|
|
<v-icon>mdi-dots-vertical</v-icon>
|
|
</v-btn>
|
|
</template>
|
|
|
|
<v-list>
|
|
<v-list-item v-if="isAuthenticated" to="/notes">
|
|
My notes
|
|
</v-list-item>
|
|
<v-list-item v-if="isAuthenticated" @click="logout">
|
|
Logout
|
|
</v-list-item>
|
|
<v-list-item v-else>
|
|
<v-btn to="/account" text rounded>Account</v-btn>
|
|
</v-list-item>
|
|
</v-list>
|
|
</v-menu>
|
|
</v-app-bar>
|
|
</template>
|
|
|
|
<script>
|
|
import { mapGetters } from 'vuex'
|
|
|
|
export default {
|
|
name: 'Navbar',
|
|
computed: {
|
|
...mapGetters(['isAuthenticated', 'loggedInUser']),
|
|
},
|
|
methods: {
|
|
async logout() {
|
|
await this.$auth.logout()
|
|
},
|
|
},
|
|
}
|
|
</script>
|