Yes
This commit is contained in:
@@ -3,10 +3,13 @@
|
||||
<v-app-bar fixed app color="primary" dark>
|
||||
<v-btn to="/" text rounded>Simple Notes</v-btn>
|
||||
<v-spacer />
|
||||
<v-btn to="/notes" class="mr-2" text rounded>My notes</v-btn>
|
||||
<v-btn v-if="this.$store.state.auth.loggedIn" outlined>
|
||||
Welcome {{ this.$store.state.auth.user.username }}
|
||||
</v-btn>
|
||||
<div v-if="isAuthenticated">
|
||||
<v-btn to="/notes" class="mr-2" text rounded>My notes</v-btn>
|
||||
<v-btn class="mr-2" outlined>
|
||||
Welcome {{ loggedInUser.username }}
|
||||
</v-btn>
|
||||
<v-btn outlined @click="logout">Logout</v-btn>
|
||||
</div>
|
||||
<v-btn v-else to="/account" text rounded>Account</v-btn>
|
||||
</v-app-bar>
|
||||
<v-content>
|
||||
@@ -18,7 +21,18 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {}
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
...mapGetters(['isAuthenticated', 'loggedInUser']),
|
||||
},
|
||||
methods: {
|
||||
async logout() {
|
||||
await this.$auth.logout()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user