Skip to content

Commit

Permalink
fix: avoid extract slots binding type by VNode[]
Browse files Browse the repository at this point in the history
close #1522
  • Loading branch information
johnsoncodehk committed Jul 7, 2022
1 parent 3a164f9 commit 75fc525
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/vue-code-gen/src/generators/template.ts
Expand Up @@ -266,7 +266,7 @@ export function generate(
},
},
);
tsCodeGen.addText(`: typeof ${slot.varName},\n`);
tsCodeGen.addText(`: (_: typeof ${slot.varName}) => any,\n`);
}
tsCodeGen.addText(`};\n`);

Expand Down
2 changes: 1 addition & 1 deletion packages/vue-typescript/src/utils/localTypes.ts
Expand Up @@ -48,7 +48,7 @@ export declare function makeOptional<T>(t: T): { [K in keyof T]?: T[K] };
export type ExtractComponentSlots<T> =
IsAny<T> extends true ? Record<string, any>
: T extends { ${slots}?: infer S } ? { [K in keyof S]-?: S[K] extends ((obj: infer O) => any) | undefined ? O : S[K] }
: T extends { ${slots}?: infer S } ? { [K in keyof S]-?: S[K] extends ((obj: infer O) => any) | undefined ? O : unknown }
: Record<string, any>;
export type FillingEventArg_ParametersLength<E extends (...args: any) => any> = IsAny<Parameters<E>> extends true ? -1 : Parameters<E>['length'];
Expand Down

0 comments on commit 75fc525

Please sign in to comment.