Interface for declaring custom options.

Example

declare module '@vue/runtime-core' {
interface ComponentCustomOptions {
beforeRouteUpdate?(
to: Route,
from: Route,
next: () => void
): void
}
}
interface ComponentCustomOptions {
    beforeRouteEnter?: NavigationGuardWithThis<undefined>;
    beforeRouteLeave?: NavigationGuard;
    beforeRouteUpdate?: NavigationGuard;
}

Hierarchy

Properties

beforeRouteEnter?: NavigationGuardWithThis<undefined>

Guard called when the router is navigating to the route that is rendering this component from a different route. Differently from beforeRouteUpdate and beforeRouteLeave, beforeRouteEnter does not have access to the component instance through this because it triggers before the component is even mounted.

Param: to

RouteLocationRaw we are navigating to

Param: from

RouteLocationRaw we are navigating from

Param: next

function to validate, cancel or modify (by redirecting) the navigation

beforeRouteLeave?: NavigationGuard

Guard called when the router is navigating away from the current route that is rendering this component.

Param: to

RouteLocationRaw we are navigating to

Param: from

RouteLocationRaw we are navigating from

Param: next

function to validate, cancel or modify (by redirecting) the navigation

beforeRouteUpdate?: NavigationGuard

Guard called whenever the route that renders this component has changed but it is reused for the new route. This allows you to guard for changes in params, the query or the hash.

Param: to

RouteLocationRaw we are navigating to

Param: from

RouteLocationRaw we are navigating from

Param: next

function to validate, cancel or modify (by redirecting) the navigation

Generated using TypeDoc