-1π
It seems the way to access the store outside a component is through the state
property and not from getters
This is the working code for the beforeEach router method:
router.js
import store from '@/store'
router.beforeEach(function (to, _, next) {
const { path } = to;
if (path !== "/signin") {
store.state.email ? next() : next("/signin");
} else {
next();
}
});
Source:stackexchange.com