Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save spiritbroski/c5d9fd39d9fc162d5957052f568dff91 to your computer and use it in GitHub Desktop.
// pages/index.vue
<template>
<Home :login="login" />
</template>
<script lang="ts">
import Cookies from 'js-cookie'
import Home from '@/components/Home.vue'
import { Component, Vue } from 'nuxt-property-decorator'
@Component({
components: {
Home,
},
})
export default class MyStore extends Vue {
public login: boolean =
Cookies.get('token') && Cookies?.get('token')?.trim() !== ''
? true
: false
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment