As you are using a sub-component (inside the route component), you will not be able to use beforeRouteLeave
directly.
Your sub-component is a child component of a route. Therefore you need to trigger the exit method of child component from your route component using Child Component Refs as explained in…
Top comments (0)