onBeforeRouteLeave

The onBeforeRouteLeave composable allows registering a route guard within a component.