I am currently working on verifying the unsaved form route before leaving, and in case the user declines, I want to prevent changing the route.
Most of it is functioning properly with
beforeRouteLeave: function (to, from, next) {
if (!confirm('Leaving form')) next(false);
}
The issue arises when dealing with route arguments, such as #/form-path?id=5
- modifying the id
argument does not trigger the beforeRouteLeave
method.
Is there a different hook that I can utilize to halt navigation when an argument changes?