export default {
props: ['user'],
data() {
return {
items: [
{ header: 'Today' },
{ avatar: 'https://vuetifyjs.com/static/doc-images/lists/1.jpg', title: 'Brunch this weekend?', subtitle: "<span class='text--primary'>Ali Connors</span> — I'll be in your neighborhood doing errands this weekend. Do you want to hang out?" },
{ divider: true, inset: true },
{ avatar: 'https://vuetifyjs.com/static/doc-images/lists/2.jpg', title: 'Summer BBQ <span class="grey--text text--lighten-1">4</span>', subtitle: "<span class='text--primary'>to Alex, Scott, Jennifer</span> — Wish I could come, but I'm out of town this weekend." },
],
vertoken: '',
};
},
watch() {
// this.vertoken = localStorage.getItem('accessToken');
// this.debouncedGetrouter();
this.verificartoken();
},
created() {
this.verificartoken();
},
methods: {
verificartoken() {
if (localStorage.getItem('accessToken') === undefined || localStorage.getItem('accessToken') === null) {
this.$router.push({ name: 'Login', params: { successAlert: true } });
}
},
token() {
return localStorage.getItem('accessToken');
},
token2() {
if (!this.token()) {
this.$router.push({ name: 'Login', params: { successAlert: true } });
}
},
},
components: {
payroll: PayRoll,
Expenses,
Incomes,
UserChart,
},
};
</script>
This is how I have my code but there is no reaction when I delete the variable manually from the localstorage.