Skip to content
On this page

useNavigation ​

Definition ​

Composable for navigation. Provides state for navigation trees depending on navigation type.

Basic usage ​

ts
const {  navigationElements, loadNavigationElements } = useNavigation(params);

Signature ​

ts
export function useNavigation(params?: {
  type?: Schemas["NavigationType"] | string;
}): UseNavigationReturn 

Parameters ​

NameTypeDescription
params
{
  type?: Schemas["NavigationType"] | string;
}

Return type ​

See UseNavigationReturn
ts
export type UseNavigationReturn = {
  /**
   * List of navigation elements
   */
  navigationElements: ComputedRef<Schemas["NavigationRouteResponse"] | null>;
  /**
   * Load navigation elements
   */
  loadNavigationElements(params: {
    depth: number;
  }): Promise<Schemas["NavigationRouteResponse"]>;
};

Properties ​

NameTypeDescription
navigationElements
ComputedRef< | null>
List of navigation elements

Methods ​

NameTypeDescription
loadNavigationElements
Promise<>
Load navigation elements
useNavigation has loaded