Skip to content

Instantly share code, notes, and snippets.

@michalbujalski
Created April 18, 2018 10:05
Show Gist options
  • Save michalbujalski/ea4c5ff5ee6d7d6eac06a5792a4e86e8 to your computer and use it in GitHub Desktop.
Save michalbujalski/ea4c5ff5ee6d7d6eac06a5792a4e86e8 to your computer and use it in GitHub Desktop.
<template>
<nav>
<router-link :to="{name: 'home'}">Home</router-link>
<router-link :to="{name: 'profile'}">Profile</router-link>
<router-link v-show="!user" :to="{name: 'signin'}">Sign in</router-link>
<router-link v-show="!!user" :to="{name: 'signout'}">Logout</router-link>
</nav>
</template>
<script>
import {mapState} from 'vuex'
export default {
computed: {
...mapState(['user'])
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment