Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(language-core): auto infer type for $refs & useTemplateRef #4644

Merged
merged 17 commits into from
Aug 25, 2024
Prev Previous commit
Next Next commit
fix: typecheck
  • Loading branch information
zhiyuanzmj committed Aug 9, 2024
commit 8c78084bdbdb92f6ee3610b1369bc2a2db2505a3
2 changes: 1 addition & 1 deletion packages/language-core/lib/codegen/script/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function* generateComponent(
if (options.sfc.script && options.scriptRanges) {
yield* generateScriptOptions(options.sfc.script, options.scriptRanges);
}
if (options.vueCompilerOptions.target >= 3.5) {
if (options.vueCompilerOptions.target >= 3.5 && scriptSetupRanges.templateRefs.length) {
yield `__typeRefs: {} as __VLS_Refs,${newLine}`;
}
yield `})`;
Expand Down
Loading