getUid

Commons
stable

Returns a stable numeric UID for the calling Vue component instance. The same instance always receives the same integer; different instances receive different integers. Useful for generating unique DOM id attributes (aria-controls, aria-labelledby, …).

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Return value

The value returned by this util.

A positive integer unique to the current component instance for the lifetime of the application.

Usage

Examples

Ready-to-paste usage snippets.

Generate a stable aria id

typescript