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

    Function defineVaporComponent

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

      Wraps Vue 3.6.0-beta.10's defineVaporComponent(). Use this to get full TypeScript inference for props, emits, and slots in Vapor components.

      Returns null if Vue 3.6.0-beta.10+ is not detected.

      Vue 3.6.0-beta.11 alignment: • Generics + runtime props now infer correctly (Vue PR #14770) — pass-through wrappers like this one preserve the generic flow: defineVaporComponent<{ label: string }>({ props: { label: String }, ... }) • Declared emits listeners are excluded from $attrs — if a component declares emits: ['select'], an onSelect handler bound by the parent is routed to the emit channel and will NOT leak into attrs. This wrapper forwards options unchanged, so the behavior flows through unmodified.

      Vue 3.6.0-beta.12 alignment: • VDOM interop state is no longer retained from emits — components that emit events inside VDOM interop trees no longer carry stale interop refs after the emit call. Wrapper is pass-through; behavior flows through unmodified.

      Parameters

      • options: any

      Returns any

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