You have already seen these arguments in the navigation guards used in the previous sections, but we haven't walked you through them yet. All guards, except the afterEach global guard, use these three arguments: to, from, and next.
The to argument:
This argument is the route object that you navigate to (hence, it is called the to argument). This object holds the parsed information of the URL and the route:
name meta path hash |
query params fullPath matched |
If you want to know more about each of these object properties, please visit https://router.vuejs.org/api/the-route-object.
The from argument:
This argument is the current route object that you navigate from. Again, this object holds the parsed information of the URL and the route:
name meta path hash |
query params fullPath matched |
The next argument:
This argument is a function you must call to move on to the next guard (middleware...