vue-router
Version:
25 lines (24 loc) • 628 B
JavaScript
/*!
* vue-router v5.5.3
* (c) 2026 Eduardo San Martin Morote
* @license MIT
*/
import { n as routeLocationKey, r as routerKey } from "./injectionSymbols-CGHHjbrE.js";
import { inject } from "vue";
// src/useApi.ts
/**
* Returns the router instance. Equivalent to using `$router` inside
* templates.
*/
function useRouter() {
return inject(routerKey);
}
/**
* Returns the current route location. Equivalent to using `$route` inside
* templates. Inside a `<RouterView>` with a `route` prop, returns that route
* instead.
*/
function useRoute(_name) {
return inject(routeLocationKey);
}
export { useRouter as n, useRoute as t };