Skip to content

Commit

Permalink
feat: support typed template slots for script setup
Browse files Browse the repository at this point in the history
close #1253
  • Loading branch information
johnsoncodehk committed Jun 2, 2022
1 parent 912f69d commit a629054
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 @@ -331,7 +331,7 @@ export function generate(
codeGen.addText(`{\n`);
}
else {
codeGen.addText(`return (await import('${vueLibName}')).defineComponent({\n`);
codeGen.addText(`const __VLS_Component = (await import('${vueLibName}')).defineComponent({\n`);
}

if (scriptSetup && scriptSetupRanges) {
Expand Down Expand Up @@ -512,6 +512,7 @@ export function generate(
}

codeGen.addText(`});\n`);
codeGen.addText(`return {} as new () => InstanceType<typeof __VLS_Component> & { $slots: typeof import('./${path.basename(fileName)}.__VLS_template').default };\n`);
codeGen.addText(`})();`);
exportdefaultEnd = codeGen.getText().length;

Expand Down

0 comments on commit a629054

Please sign in to comment.