Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
so1ve committed Jun 27, 2023
1 parent a7300f3 commit 48bbdc1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vue-language-core/src/generators/template.ts
Expand Up @@ -670,7 +670,7 @@ export function generate(
);
}
else if (componentVars[tag]) {
codes.push(`const ${var_originalComponent} = __VLS_templateComponents['${componentVars[tag]}'];\n`);
codes.push(`const ${var_originalComponent} = {} as __VLS_AccessComponent<typeof __VLS_localComponents, __VLS_GlobalComponents, typeof __VLS_templateComponents, '${componentVars[tag]}'>;\n`);
}
else {
codes.push(`const ${var_originalComponent} = {} as any;\n`);
Expand Down
6 changes: 6 additions & 0 deletions packages/vue-language-core/src/utils/directorySharedTypes.ts
Expand Up @@ -29,6 +29,12 @@ type __VLS_GlobalComponents =
| 'Teleport'
>;
type __VLS_AccessComponent<L, G, T, K> =
K extends keyof L ? L[K] :
K extends keyof G ? G[K] :
K extends keyof T ? T[K] :
any;
// v-for
declare function __VLS_getVForSourceType(source: number): [number, number, number][];
declare function __VLS_getVForSourceType(source: string): [string, number, number][];
Expand Down

0 comments on commit 48bbdc1

Please sign in to comment.