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

    Function defineVaporCustomElement

    • defineVaporCustomElement — create a custom element backed by Vapor rendering.

      Wraps Vue 3.6.0-beta.10's defineVaporCustomElement(). The generated custom element uses Vapor's compiler-optimized rendering instead of the VDOM, giving zero-overhead DOM updates inside shadow DOM.

      SSR runtime is automatically tree-shaken from the generated code (beta.10 fix).

      Returns null if Vue 3.6.0-beta.10+ is not detected — check before calling customElements.define().

      Parameters

      • options: any
      • OptionalextraOptions: any

      Returns any

      import { defineVaporCustomElement } from 'vapor-chamber';
      const MyEl = defineVaporCustomElement({
      props: { label: String },
      setup(props) { return () => h('span', props.label); }
      });
      if (MyEl) customElements.define('vc-greeting', MyEl);