requireModelInfo
Overview
Require model info to be loaded before accessing the route.
Signature
requireModelInfo(instance, redirectTo, to, router, pinia)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| instance | App | yes | The Vue app instance. |
| redirectTo | string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | yes | Where to redirect if model info not found or action not allowed. |
| to | RouteLocationNormalizedLoadedGeneric | yes | The target route. |
| router | Router | yes | The router instance. |
| pinia | Pinia | yes | The 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