Skip to content

Commit

Permalink
fix: count variable usage in template even jsx disable
Browse files Browse the repository at this point in the history
close #1168
  • Loading branch information
johnsoncodehk committed Aug 27, 2022
1 parent a034d1b commit 6f79f8f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/vue-language-core/src/generators/script.ts
Expand Up @@ -457,7 +457,12 @@ export function generate(
writeComponentForTemplateUsage(templateGened.cssIds);
}
else {
codeGen.addText(`const __VLS_template = () => ({});\n`);
codeGen.addText(`function __VLS_template() {\n`);
const templateUsageVars = [...getTemplateUsageVars()];
codeGen.addText(`// @ts-ignore\n`);
codeGen.addText(`[${templateUsageVars.join(', ')}]\n`);
codeGen.addText(`return {};\n`);
codeGen.addText(`}\n`);
}
}
function writeComponentForTemplateUsage(cssIds: Set<string>) {
Expand Down

0 comments on commit 6f79f8f

Please sign in to comment.