Skip to content

onBeforeRouteLeave

ts
function onBeforeRouteLeave(hook): RouteHookRemove

Registers a hook that is called before a route is left. Must be called from setup. This is useful for performing actions or cleanups before navigating away from a route component.

Parameters

ParameterType
hookBeforeRouteHook

Returns

RouteHookRemove

A function that removes the added hook.