-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed as not planned
Description
Reproduction
https://stackblitz.com/edit/vitejs-vite-9iezka?file=src/vue.d.ts
Steps to reproduce the bug
Using vite, create a d.ts file extending ComponentCustomProperties
Use $route
or $router
in any component template.
Try to build your code with npm run build
Expected behavior
When using vue-router 4.1.6, there is no compilation error.
Actual behavior
Here is the error durring code build :
error TS2339: Property '$route' does not exist on type '{ $: ComponentInternalInstance; $data: {}; $props: { key?: string | number | symbol | undefined; ref?: VNodeRef | undefined; ref_for?: boolean | undefined; ... 8 more ...; style?: unknown; }; ... 10 more ...; $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (arg...'.
2 <div>{{ $route.name }}</div>
~~~~~~
Found 1 error in src/pages/Home.vue:2·
Additional information
No response
peter50216, gerardhoogland-united, Mini-ghost, mauricewegner, kingyue737 and 4 more
Metadata
Metadata
Assignees
Labels
No labels