vue-router / RouteMeta
RouteMeta
Interface to type meta fields in route records.
Example
ts
// typings.d.ts or router.ts
import 'vue-router';
declare module 'vue-router' {
interface RouteMeta {
requiresAuth?: boolean
}
}Extends
Record<PropertyKey,unknown>
Indexable
ts
[key: string]: unknownts
[key: number]: unknownts
[key: symbol]: unknownProperties
[ABORT_CONTROLLER_KEY]?
ts
optional [ABORT_CONTROLLER_KEY]: AbortController;Internal
The signal that is aborted when the navigation is canceled or an error occurs.
[LOADER_SET_KEY]?
ts
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?
ts
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.

