useRoute
Check if the current location matches a route pattern.
Description
Returns a tuple [matches, params] where:
matchesis a reactiveRef<boolean>indicating if the route matchesparamsis a reactiveRef<RouteParams>containing extracted route parameters
Parameters
pattern: string | RegExp- Route pattern to match against
Returns
Example
Notes
- The pattern matching uses path-to-regexp
- Supports all standard route patterns (named params, constraints, wildcards, etc.)
- See Route Pattern Matching for detailed pattern examples