From b43708edb7858b809593cdb2fd82b735eecefb07 Mon Sep 17 00:00:00 2001 From: zhiyuanzmj <32807958+zhiyuanzmj@users.noreply.github.com> Date: Thu, 5 Sep 2024 02:50:55 +0800 Subject: [PATCH] fix(language-core): prevent type error when use defineSlots and non-template (#4809) * fix(language-core): prevent type error when use defineSlots and no template * fix: typo --- packages/language-core/lib/codegen/script/template.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/language-core/lib/codegen/script/template.ts b/packages/language-core/lib/codegen/script/template.ts index 44dbbc59ce..41ada8269f 100644 --- a/packages/language-core/lib/codegen/script/template.ts +++ b/packages/language-core/lib/codegen/script/template.ts @@ -175,9 +175,9 @@ function* generateTemplateBody( yield `// no template${newLine}`; if (!options.scriptSetupRanges?.slots.define) { yield `const __VLS_slots = {}${endOfLine}`; - yield `const $refs = {}${endOfLine}`; - yield `const __VLS_inheritedAttrs = {}${endOfLine}`; } + yield `const $refs = {}${endOfLine}`; + yield `const __VLS_inheritedAttrs = {}${endOfLine}`; } yield `return {${newLine}`;