Interface Route<T, R, C>

Defines a single route.

A route represents a single or multiple sections in the URL. It defines the behavior of a page in response to URL updates. A route can act as a content producer or as middleware for child routes.

interface Route<T, R, C> {
    children?: readonly Route<T, R, C>[] | ChildrenCallback<T, R, C>;
    fullPath?: string;
    name?: string;
    parent?: Route<T, R, C>;
    path: string;
}

Type Parameters

  • T = unknown

    The type of the result produced by the route.

  • R extends object = EmptyObject

    The type of additional route-specific data. Defaults to an empty object.

  • C extends object = EmptyObject

    The type of user-defined context-specific data. Defaults to an empty object.

Properties

children?: readonly Route<T, R, C>[] | ChildrenCallback<T, R, C>
fullPath?: string
name?: string

The name of the route.

parent?: Route<T, R, C>
path: string

The path pattern that the route matches.