Skip to content

Commit d7a1e83

Browse files
committed
fix(language-core): special handling Vue 2.7 async component
close #4789
1 parent c23b332 commit d7a1e83

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

packages/language-core/lib/codegen/globalTypes.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ export function generateGlobalTypes({
165165
function __VLS_asFunctionalComponent<T, K = T extends new (...args: any) => any ? InstanceType<T> : unknown>(t: T, instance?: K):
166166
T extends new (...args: any) => any ? __VLS_FunctionalComponent<K>
167167
: T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
168+
${(
169+
target === 2.7
170+
? `: T extends import('vue').AsyncComponent ? (props: {}, ctx?: any) => any`
171+
: ``
172+
)}
168173
: T extends (...args: any) => any ? T
169174
: __VLS_FunctionalComponent<{}>;
170175
function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(t: T): 2 extends Parameters<T>['length'] ? [any] : [];
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<template>
2+
<HelloWorld />
3+
</template>
4+
5+
<script setup lang="ts">
6+
import { defineAsyncComponent } from 'vue';
7+
8+
const HelloWorld = defineAsyncComponent(() => ({} as any));
9+
</script>

0 commit comments

Comments
 (0)