Appearance
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?: StoreNavigationType;
}): UseNavigationReturn
Parameters
Name | Type | Description |
---|---|---|
params | { type?: StoreNavigationType; } |
Return type
See UseNavigationReturn
ts
export type UseNavigationReturn = {
/**
* List of navigation elements
*/
navigationElements: ComputedRef<StoreNavigationElement[] | null>;
/**
* Load navigation elements
*/
loadNavigationElements(params: {
depth: number;
}): Promise<StoreNavigationElement[]>;
};
Properties
Name | Type | Description |
---|---|---|
navigationElements | ComputedRef<Array<StoreNavigationElement> | null> | List of navigation elements |
Methods
Name | Type | Description |
---|---|---|
loadNavigationElements | Promise<Array<StoreNavigationElement>> | Load navigation elements |