Skip to content

requireModelInfo

Overview

Require model info to be loaded before accessing the route.

Signature

requireModelInfo(instance, redirectTo, to, router, pinia)

Parameters

NameTypeRequiredDescription
instanceAppyesThe Vue app instance.
redirectTostring | RouteLocationAsRelativeGeneric | RouteLocationAsPathGenericyesWhere to redirect if model info not found or action not allowed.
toRouteLocationNormalizedLoadedGenericyesThe target route.
routerRouteryesThe router instance.
piniaPiniayesThe Pinia instance.

Returns

Promise

true when the model exists and the action is allowed, a redirect route when it does not, or false to cancel the navigation because the authenticated user changed while the metadata was being fetched.

Source

client/lib/router/guards.js:292

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2