Pārlūkot izejas kodu

types: creating Teleport with h and RawSlots #2613 (#2614)

edison 3 gadi atpakaļ
vecāks
revīzija
824174915f
2 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 1 1
      packages/runtime-core/src/h.ts
  2. 1 0
      test-dts/h.test-d.ts

+ 1 - 1
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

+ 1 - 0
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