Skip to content

Commit 19cc0f5

Browse files
committed
fix: omit local components from global components
close #1886
1 parent cc4288a commit 19cc0f5

File tree

1 file changed

+2
-1
lines changed
  • vue-language-tools/vue-language-core/src/generators

1 file changed

+2
-1
lines changed

vue-language-tools/vue-language-core/src/generators/script.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,8 @@ export function generate(
626626

627627
/* Components */
628628
codeGen.push('/* Components */\n');
629-
codeGen.push(`let __VLS_otherComponents!: NonNullable<typeof __VLS_component extends { components: infer C } ? C : {}> & import('./__VLS_types.js').GlobalComponents & typeof __VLS_componentsOption & typeof __VLS_ctx;\n`);
629+
codeGen.push(`let __VLS_localComponents!: NonNullable<typeof __VLS_component extends { components: infer C } ? C : {}> & typeof __VLS_componentsOption & typeof __VLS_ctx;\n`);
630+
codeGen.push(`let __VLS_otherComponents!: typeof __VLS_localComponents & Omit<import('./__VLS_types.js').GlobalComponents, keyof typeof __VLS_localComponents>;\n`);
630631
codeGen.push(`let __VLS_selfComponent!: import('./__VLS_types.js').SelfComponent<typeof __VLS_name, typeof __VLS_component & (new () => { ${getSlotsPropertyName(vueCompilerOptions.target ?? 3)}: typeof __VLS_slots })>;\n`);
631632
codeGen.push(`let __VLS_components!: typeof __VLS_otherComponents & Omit<typeof __VLS_selfComponent, keyof typeof __VLS_otherComponents>;\n`);
632633

0 commit comments

Comments
 (0)