diff --git a/src/types/vue-router.d.ts b/src/types/vue-router.d.ts index 87b0d8c..e759cf6 100644 --- a/src/types/vue-router.d.ts +++ b/src/types/vue-router.d.ts @@ -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; -// } - \ No newline at end of file