From 8024f058ccf13dd8b56f3cded50109fb58efc10c Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 3 Oct 2018 13:14:22 -0400 Subject: [PATCH] fix: fix internal components render signature --- packages/core/src/optional/asyncComponent.ts | 2 +- packages/core/src/optional/context.ts | 4 ++-- packages/core/src/optional/keepAlive.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/src/optional/asyncComponent.ts b/packages/core/src/optional/asyncComponent.ts index 752035a3..1267fa3f 100644 --- a/packages/core/src/optional/asyncComponent.ts +++ b/packages/core/src/optional/asyncComponent.ts @@ -77,7 +77,7 @@ export function createAsyncComponent( } } - render(props: any, slots: Slots) { + render(_: any, { props, slots }: { props: any; slots: Slots }) { if (this.err || (this.timedOut && !this.comp)) { const error = this.err || new Error(`Async component timed out after ${timeout}ms.`) diff --git a/packages/core/src/optional/context.ts b/packages/core/src/optional/context.ts index c04eb228..59793040 100644 --- a/packages/core/src/optional/context.ts +++ b/packages/core/src/optional/context.ts @@ -31,7 +31,7 @@ export class Provide extends Component { beforeUpdate() { this.updateValue() } - render(_: any, slots: Slots) { + render(_: any, { slots }: { slots: Slots }) { return slots.default && slots.default() } } @@ -49,7 +49,7 @@ Provide.options = { } export class Inject extends Component { - render(props: any, slots: Slots) { + render(_: any, { props, slots }: { props: any; slots: Slots }) { return slots.default && slots.default(contextStore[props.id]) } } diff --git a/packages/core/src/optional/keepAlive.ts b/packages/core/src/optional/keepAlive.ts index c36fc52c..ca3de37c 100644 --- a/packages/core/src/optional/keepAlive.ts +++ b/packages/core/src/optional/keepAlive.ts @@ -49,7 +49,7 @@ export class KeepAlive extends Component<{}, KeepAliveProps> { this.keys.delete(key) } - render(props: any, slots: Slots) { + render(_: any, { props, slots }: { props: any; slots: Slots }) { if (!slots.default) { return }