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.
[NAVIGATION_RESULTS_KEY]?
optional [NAVIGATION_RESULTS_KEY]: NavigationResult[];Internal
The navigation results when the navigation is canceled by the user within a data loader.
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.

