wouter-vue Documentation

useRoute

Check if the current location matches a route pattern.

Description

Returns a tuple [matches, params] where:

  • matches is a reactive Ref<boolean> indicating if the route matches
  • params is a reactive Ref<RouteParams> containing extracted route parameters

Parameters

  • pattern: string | RegExp - Route pattern to match against

Returns

Example

Notes

Built with wouter-vue • GitHub