diff --git a/packages/runtime-web/src/runtime/public/component.tsx b/packages/runtime-web/src/runtime/public/component.tsx index 6938d917..bbb9d38e 100644 --- a/packages/runtime-web/src/runtime/public/component.tsx +++ b/packages/runtime-web/src/runtime/public/component.tsx @@ -463,7 +463,7 @@ export class KBComponent extends React.PureComponent { const $slots = {} if (this.props.children) { if (this.props.children instanceof Array) { - this.props.children.forEach((i) => { + this.props.children.forEach((i: ReactNodeSlot) => { if (i.props && i.props._slot) { $slots[i.props._slot] = i } diff --git a/packages/runtime-web/src/types/index.d.ts b/packages/runtime-web/src/types/index.d.ts index 50751204..2bad3728 100644 --- a/packages/runtime-web/src/types/index.d.ts +++ b/packages/runtime-web/src/types/index.d.ts @@ -1,4 +1,6 @@ /// +/// + type PromiseOptions = Omit type IGetLocationFailErrorType = 11 | 12 | 13 | 14 @@ -7,6 +9,13 @@ interface PhoneOptions { [number: string]: string } +interface ReactNodeSlot extends ReactNode { + props?: { + _slot: string + [prop: string]: any + } +} + interface Window { my: any getApp: () => IApp