Skip to content

Commit

Permalink
fix(language-core): improve fallthrough attributes and defineEmit com…
Browse files Browse the repository at this point in the history
…patibility
  • Loading branch information
johnsoncodehk committed Aug 27, 2024
1 parent 21205fb commit d94bd3c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/language-core/lib/codegen/script/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,11 @@ export function* generatePropsOption(
const { arg } = scriptSetupRanges.props.define;
optionExpCodes.push(generateSfcBlockSection(scriptSetup, arg.start, arg.end, codeFeatures.navigation));
}
if (inheritAttrs && options.templateCodegen?.inheritedAttrVars.size && !hasEmitsOption) {
const attrsType = `ReturnType<typeof __VLS_template>['attrs']`;
if (inheritAttrs && options.templateCodegen?.inheritedAttrVars.size) {
let attrsType = `ReturnType<typeof __VLS_template>['attrs']`;
if (hasEmitsOption) {
attrsType = `Omit<${attrsType}, \`on\${string}\`>`;
}
const propsType = `__VLS_PickNotAny<${ctx.helperTypes.OmitIndexSignature.name}<${attrsType}>, {}>`;
const optionType = `${ctx.helperTypes.TypePropsToOption.name}<${propsType}>`;
if (optionExpCodes.length) {
Expand Down

0 comments on commit d94bd3c

Please sign in to comment.