From: edison Date: Mon, 3 Oct 2022 08:40:37 +0000 (+0800) Subject: types: creating Teleport with h and RawSlots #2613 (#2614) X-Git-Tag: v3.2.41~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=824174915f274cc30f10af2fbc7b323709ab34bd;p=thirdparty%2Fvuejs%2Fcore.git types: creating Teleport with h and RawSlots #2613 (#2614) --- diff --git a/packages/runtime-core/src/h.ts b/packages/runtime-core/src/h.ts index f22e4bb30d..44f9134082 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 c71b54a2aa..5318f71fe9 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