In my router.js file, when I'm using the beforeEach method, I get path and fullPath in the properties of to and from parameters. I'm wondering which one I should use for redirection purpose. I've seen both been used and I don't when to use which, and what is the difference between both.
An exemple:
export default new Router({
mode: 'history',
base: process.env.BASE_URL,
routes: [{
path: 'login'
beforeEnter: (to, from, next) => {
console.log(to, from) // the routes
if (User.loggedIn()) {
next(from.fullPath) // or maybe `from.path`
} else {
next()
}
},
}]
})