Skip to content

Instantly share code, notes, and snippets.

@spiritbroski
Created December 5, 2020 02:24
Show Gist options
  • Select an option

  • Save spiritbroski/bd284fe7f57e5399b25c40825f7744f8 to your computer and use it in GitHub Desktop.

Select an option

Save spiritbroski/bd284fe7f57e5399b25c40825f7744f8 to your computer and use it in GitHub Desktop.
<template>
...
<v-btn
:class="['my-2']"
color="info"
elevation="2"
v-show="login"
href="/dashboard"
>DASHBOARD</v-btn
>
...
<v-btn
:class="['my-2', 'mx-2']"
color="error"
elevation="2"
v-show="login"
@click="logout"
>LOGOUT</v-btn
>
...
</template>
<script lang="ts">
import Cookies from 'js-cookie'
...
export default class MyStore extends Vue {
@Prop({ required: true }) readonly login!: boolean
logout() {
Cookies.remove('token')
window.location.reload()
}
}
...
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment