Skip to content

Compositions: useRouter ​

ts
const useRouter: RouterAssets<RegisteredRouter>["useRouter"];

A composition to access the installed router instance within a Vue component.

Returns ​

The installed router instance.

Throws ​

Throws an error if the router has not been installed, ensuring the component does not operate without routing functionality.