Derive the per-instance id prefix used by the Vue SFCs.
Prefers Vue 3.5+ useId() (which guarantees per-component
uniqueness across SSR/CSR hydration). Older Vue runtimes expose
useId as a function returning undefined or omit it entirely
— the helper falls back to a monotonic counter scoped to this
module so the resulting prefix is still deterministic and
collision-free within a single render tree.
Must be called from within a setup() invocation: Vue's useId
only resolves inside an active component instance.
Derive the per-instance id prefix used by the Vue SFCs.
Prefers Vue 3.5+
useId()(which guarantees per-component uniqueness across SSR/CSR hydration). Older Vue runtimes exposeuseIdas a function returningundefinedor omit it entirely — the helper falls back to a monotonic counter scoped to this module so the resulting prefix is still deterministic and collision-free within a single render tree.Must be called from within a
setup()invocation: Vue'suseIdonly resolves inside an active component instance.