diff --git a/packages/language-core/lib/codegen/template/element.ts b/packages/language-core/lib/codegen/template/element.ts index ed9c9e2987..ebab612e2d 100644 --- a/packages/language-core/lib/codegen/template/element.ts +++ b/packages/language-core/lib/codegen/template/element.ts @@ -265,7 +265,9 @@ export function* generateComponent( if (hasVBindAttrs(options, ctx, node)) { const attrsVar = ctx.getInternalVariable(); - yield `var ${attrsVar}!: Parameters[0]${endOfLine}`; + ctx.currentComponent.used = true; + + yield `var ${attrsVar}!: NonNullable${endOfLine}`; ctx.inheritedAttrVars.add(attrsVar); } diff --git a/test-workspace/tsc/passedFixtures/fallthroughAttributes_strictTemplate/generic/basic.vue b/test-workspace/tsc/passedFixtures/fallthroughAttributes_strictTemplate/generic/basic.vue index 2948bd76a6..a9b11d9259 100644 --- a/test-workspace/tsc/passedFixtures/fallthroughAttributes_strictTemplate/generic/basic.vue +++ b/test-workspace/tsc/passedFixtures/fallthroughAttributes_strictTemplate/generic/basic.vue @@ -2,10 +2,10 @@ import child from './child.vue'; defineProps<{ - foo?: T; + bar?: T; }>(); diff --git a/test-workspace/tsc/passedFixtures/fallthroughAttributes_strictTemplate/generic/child.vue b/test-workspace/tsc/passedFixtures/fallthroughAttributes_strictTemplate/generic/child.vue index 3e043b3148..16acba6785 100644 --- a/test-workspace/tsc/passedFixtures/fallthroughAttributes_strictTemplate/generic/child.vue +++ b/test-workspace/tsc/passedFixtures/fallthroughAttributes_strictTemplate/generic/child.vue @@ -1,5 +1,8 @@ - diff --git a/test-workspace/tsc/passedFixtures/fallthroughAttributes_strictTemplate/generic/main.vue b/test-workspace/tsc/passedFixtures/fallthroughAttributes_strictTemplate/generic/main.vue index e2e0faaf11..8494499af4 100644 --- a/test-workspace/tsc/passedFixtures/fallthroughAttributes_strictTemplate/generic/main.vue +++ b/test-workspace/tsc/passedFixtures/fallthroughAttributes_strictTemplate/generic/main.vue @@ -1,7 +1,8 @@