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

    Function configureVue

    • configureVue — hand the library Vue's module namespace explicitly.

      The reliable channel — recommended for every consumer who wants deterministic Vapor wiring, bundler or not. It seeds the registry synchronously (no probe race, wrappers' null path becomes unreachable) and is the one channel that behaves identically however the page obtains Vapor: bundler alias, import map, or the esm-browser dist. Essential on no-bundler pages, where it is the only channel that cannot come up empty: Detection otherwise depends on either a global slot Vue overwrites when the first app mounts (see VUE_GLOBAL_KEY) or a bare-specifier import('vue') that cannot resolve in a browser at all — so on a <script>-tag page the two automatic channels can both come up empty while Vapor is sitting right there, and createVaporChamberApp() throws "Vue 3.6+ with Vapor mode required" on a page that has it.

      Call this before creating signals or apps. Safe to call more than once; the last usable namespace wins. Mirrors configureSignal() — an explicit escape hatch that removes a guess.

      IMPORTANT: pass the SAME Vue instance the rest of the page uses. Two separately-imported Vue dist files are two disconnected reactivity engines (a ref() from one is invisible to a watchEffect from the other, with no error) — see the note in probeVue below.

      Parameters

      • vue: object

      Returns void

      import * as Vue from 'vue/dist/vue.runtime-with-vapor.esm-browser.js';
      import { configureVue, createVaporChamberApp } from 'vapor-chamber';
      configureVue(Vue);
      createVaporChamberApp(App).mount('#app');