Vue.js · Hook
useRouter
useRoute() returns the current route location in a Vue Router component. It is the Composition API equivalent of $route in templates.
Last updated
Syntax
function useRoute<Name>(_name?): RouteLocationNormalizedLoadedGeneric;In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
useRouterrouterViewLocationKeyrouteLocationKeyRouterViewRouteLocationNormalizedLoadedGeneric