Skip to content

Commit

Permalink
fix: expand template slots type when emit dts
Browse files Browse the repository at this point in the history
close #1459
  • Loading branch information
johnsoncodehk committed Jun 17, 2022
1 parent cefed1e commit 51b8877
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vue-code-gen/src/generators/script.ts
Expand Up @@ -525,7 +525,8 @@ export function generate(
codeGen.addText(`return __VLS_Component;\n`);
}
else {
codeGen.addText(`return {} as typeof __VLS_Component & (new () => { ${getSlotsPropertyName(vueVersion)}: typeof import('./${path.basename(fileName)}.__VLS_template').default });\n`);
codeGen.addText(`const __VLS_slots = (await import('./${path.basename(fileName)}.__VLS_template')).default;\n`)
codeGen.addText(`return {} as typeof __VLS_Component & (new () => { ${getSlotsPropertyName(vueVersion)}: typeof __VLS_slots });\n`);
}
codeGen.addText(`})();`);
exportdefaultEnd = codeGen.getText().length;
Expand Down

0 comments on commit 51b8877

Please sign in to comment.