From 824174915f274cc30f10af2fbc7b323709ab34bd Mon Sep 17 00:00:00 2001 From: edison Date: Mon, 3 Oct 2022 16:40:37 +0800 Subject: [PATCH] types: creating Teleport with h and RawSlots #2613 (#2614) --- packages/runtime-core/src/h.ts | 2 +- test-dts/h.test-d.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/h.ts b/packages/runtime-core/src/h.ts index f22e4bb30d0..44f91340827 100644 --- a/packages/runtime-core/src/h.ts +++ b/packages/runtime-core/src/h.ts @@ -108,7 +108,7 @@ export function h( export function h( type: typeof Teleport, props: RawProps & TeleportProps, - children: RawChildren + children: RawChildren | RawSlots ): VNode // suspense diff --git a/test-dts/h.test-d.ts b/test-dts/h.test-d.ts index c71b54a2aa8..5318f71fe94 100644 --- a/test-dts/h.test-d.ts +++ b/test-dts/h.test-d.ts @@ -47,6 +47,7 @@ describe('h inference w/ Fragment', () => { describe('h inference w/ Teleport', () => { h(Teleport, { to: '#foo' }, 'hello') + h(Teleport, { to: '#foo' }, { default() {} }) // @ts-expect-error expectError(h(Teleport)) // @ts-expect-error