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

    Function defineVaporComponent

    • defineVaporComponent — define a Vapor component with proper type inference.

      Wraps Vue's defineVaporComponent() (typed since 3.6.0-alpha.5, #13831). Use this to get full TypeScript inference for props, emits, and slots in Vapor components. Pass-through — emits/$attrs routing, v-once interop, scope IDs, and the compiler optimizations are Vue behavior (per-beta detail: CHANGELOG / whitepaper alignment log).

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

      Type Parameters

      • T = any

      Parameters

      • options: object

      Returns T | null

      import { defineVaporComponent } from 'vapor-chamber';
      const Comp = defineVaporComponent({
      props: { count: Number },
      emits: ['change'],
      setup(props) { return () => h('div', `Count: ${props.count}`); }
      });