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