diff --git a/packages/runtime-core/src/h.ts b/packages/runtime-core/src/h.ts index eebee368..b7a9ff49 100644 --- a/packages/runtime-core/src/h.ts +++ b/packages/runtime-core/src/h.ts @@ -5,7 +5,8 @@ import { VNodeChildren, Fragment, Portal, - isVNode + isVNode, + Suspense } from './vnode' import { isObject, isArray } from '@vue/shared' import { Ref } from '@vue/reactivity' @@ -102,6 +103,19 @@ export function h( children?: RawChildren ): VNode +// suspense +export function h(type: typeof Suspense, children?: RawChildren): VNode +export function h( + type: typeof Suspense, + props?: + | (RawProps & { + onResolve?: () => void + onRecede?: () => void + }) + | null, + children?: RawChildren | RawSlots +): VNode + // functional component export function h(type: FunctionalComponent, children?: RawChildren): VNode export function h
(
diff --git a/packages/runtime-core/src/suspense.ts b/packages/runtime-core/src/suspense.ts
index 2a7019c7..bda5ae07 100644
--- a/packages/runtime-core/src/suspense.ts
+++ b/packages/runtime-core/src/suspense.ts
@@ -196,7 +196,7 @@ export interface SuspenseBoundary<
isUnmounted: boolean
effects: Function[]
resolve(): void
- restart(): void
+ recede(): void
move(container: HostElement, anchor: HostNode | null): void
next(): HostNode | null
registerDep(
@@ -315,7 +315,7 @@ function createSuspenseBoundary