Hii I'm getting this error Cannot read properties of undefined (reading '$store'): This is my router(index.js)
{
path: '/',
name: 'login',
component: () => import( /* webpackChunkName: "hours" */ '../views/login.vue'),
meta: {
hideNavbar: true,
},
beforeEnter: (to, from, next) => {
if (this.$store.state.authenticated.admin === true) {
next('/home');
} else {
next(false);
}
}
In this above code I'm Struggling to navigate to the home page...getting this error. here`TypeError: Cannot read properties of undefined (reading '$store')