vapor-chamber API reference - v1.16.0
    Preparing search index...

    Function defineVaporAsyncComponent

    • defineVaporAsyncComponent — define an async Vapor component for lazy loading.

      Wraps Vue's defineVaporAsyncComponent() (introduced in 3.6.0-alpha.3, #13059). Async Vapor components are cached by VaporKeepAlive and hydrate under VDOM Suspense. The loading placeholder receives the deferred component's props and slots (beta.14+) — render a skeleton matching the final shape. Per-beta detail: CHANGELOG / whitepaper alignment log.

      Returns null if the Vapor runtime (Vue 3.6+) is not detected.

      Type Parameters

      • T = any

      Parameters

      • loader: object | (() => Promise<unknown>)

      Returns T | null

      import { defineVaporAsyncComponent } from 'vapor-chamber';
      const AsyncPanel = defineVaporAsyncComponent(() => import('./Panel.vue'));