Created
December 5, 2020 02:24
-
-
Save spiritbroski/bd284fe7f57e5399b25c40825f7744f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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