wouter-vue Documentation

useRouter

Get the router instance for advanced operations.

Description

Returns the router instance, which provides access to advanced routing operations like custom location hooks, programmatic navigation, and router configuration.

Returns

Example

Advanced Usage

Most use cases are covered by other composables like useLocation() and useParams(). Use useRouter() when you need:

  • Custom location hooks
  • Direct access to router internals
  • Advanced subscription patterns

See Also

Built with wouter-vue • GitHub