getIds

Commons
stable

Converts an array of model values to an array of internal group item IDs, supporting both value-based lookup and index-based fallback. Used by the group selection logic (Tabs, BtnToggle, etc.).

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

items
required
UnwrapRef<Array<IGroupItem>>
The reactive list of registered group items, each carrying an id and a value.
modelValue
required
Array<any>
The array of selected values to resolve. Each entry is matched first by deep equality against item.value, then by array index as a fallback.

API

Return value

The value returned by this util.

Array of internal numeric IDs corresponding to the matched items. Unresolved entries are silently skipped.

Usage

Examples

Ready-to-paste usage snippets.

Resolve model values to IDs

typescript