Vue.js 58 🟢 Navigation Guards (Global beforeEach, Per-Route beforeEnter, In-Component onBeforeRouteLeave)
Navigation guards are the control points where a Vue application decides whether a route transition should proceed, be cancelled, or be redirected. They exist because navigation is not always safe: a user might be navigating to a page they are not authenticated for, or leaving a form with unsaved changes, or entering a route that…