vue-router / RouteMeta
RouteMeta
Interface to type meta fields in route records.
Example
// typings.d.ts or router.ts
import 'vue-router';
declare module 'vue-router' {
interface RouteMeta {
requiresAuth?: boolean
}
}Extends
Record<PropertyKey,unknown>
Indexable
[key: string]: unknown[key: number]: unknown[key: symbol]: unknownProperties
[ABORT_CONTROLLER_KEY]?
optional [ABORT_CONTROLLER_KEY]?: AbortController;Internal
The signal that is aborted when the navigation is canceled or an error occurs.
[LOADER_SET_KEY]?
optional [LOADER_SET_KEY]?: Set<UseDataLoader<unknown, unknown>>;Internal
Set of loaders for the current route. This is built once during navigation and is used to merge the loaders from the lazy import in components or the loaders array in the route record.
loaders?
optional loaders?: UseDataLoader<unknown, unknown>[];The data loaders for a route record. Add any data loader to this array to have it called when the route is navigated to. Note this is only needed when not using lazy components (() => import('./pages/Home.vue')) or when not explicitly exporting data loaders from page components.
This requires the use of the experimental data loaders and is ignored otherwise.
See
DataLoaderPlugin
