Skip to content

vue-mvvm / router / RouteAdapter

RouteAdapter

Adapter to expose routing information used by the RouterService.

Properties

native?

ts
optional native: Omit<RouteRecordSingleView, "path" | "component" | "beforeEnter" | "children">;

params?

ts
optional params: Record<string, RouteParamTypes>;

The type definition of path parameters ("/:myID") in the path property


path

ts
path: string;

The path that the Item should listen to. Follows the same syntax like the vue-router path definition syntax

Methods

guard()?

ts
optional guard(ctx): RouteAdapterGuardReturn;

Optional method to provide a guard for route access. This method allows implementing route-level restrictions or validations before granting access to a specific route within the application.

Parameters

ctx

ReadableGlobalContext

Returns

RouteAdapterGuardReturn

The result of the guard evaluation, which is either true or another ViewModel to which the router should redirect. On redirection the guard, if defined, of the redirecting item will be executed