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

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

items
requis
UnwrapRef<Array<IGroupItem>>
The reactive list of registered group items, each carrying an id and a value.
modelValue
requis
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

Valeur de retour

La valeur retournée par cet util.

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

Usage

Exemples

Extraits de code prêts à coller.

Resolve model values to IDs

typescript