Migrate router type augmentation to Vue 3 runtime core

Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
2026-03-08 11:55:06 +08:00
parent 28c861ab0e
commit ef9cf2de8c

View File

@@ -4,26 +4,19 @@
// cindy.chang@dsp.im (Cindy Chang), 2024/7/9
/**
* @module types/vue-router.d
* Vue Router type augmentation for the Vue
* instance $router and $route properties.
* Vue 3 component instance type augmentation for
* `$router` and `$route` properties.
*/
import { Router, RouteLocationNormalized } from 'vue-router';
import type { Router, RouteLocationNormalizedLoaded } from 'vue-router';
/** Augments the Vue instance with router properties. */
declare module 'vue/types/vue' {
/** Vue instance augmentation. */
interface Vue {
/** Augments Vue 3 component instance properties with router types. */
declare module '@vue/runtime-core' {
/** Component custom property augmentation. */
interface ComponentCustomProperties {
/** The Vue Router instance. */
$router: Router;
/** The current normalized route location. */
$route: RouteLocationNormalized;
$route: RouteLocationNormalizedLoaded;
}
}
// declare module '@router' {
// import { Router } from 'vue-router';
// const router: Router;
// export default router;
// }