]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
types: creating Teleport with h and RawSlots #2613 (#2614)
authoredison <daiwei521@126.com>
Mon, 3 Oct 2022 08:40:37 +0000 (16:40 +0800)
committerGitHub <noreply@github.com>
Mon, 3 Oct 2022 08:40:37 +0000 (16:40 +0800)
packages/runtime-core/src/h.ts
test-dts/h.test-d.ts

index f22e4bb30d06d3195a82abcf2cec0b2478aab079..44f91340827dfc95a3a9898c91b22bd651776c83 100644 (file)
@@ -108,7 +108,7 @@ export function h(
 export function h(
   type: typeof Teleport,
   props: RawProps & TeleportProps,
-  children: RawChildren
+  children: RawChildren | RawSlots
 ): VNode
 
 // suspense
index c71b54a2aa8ef8b5ef9e16b305e54c564b797860..5318f71fe9418c09931bcbc37602fb9e346fc16d 100644 (file)
@@ -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