LIST_OPEN_STRATEGY

const
Navigation & Disclosure

Open strategy for list-style navigation (e.g. OrigamList). Uses MULTIPLE_OPEN_STRATEGY for opening and a custom select handler that closes all siblings not on the path from the selected item to the root.

TypeScript

Définition

La définition TypeScript telle qu'elle apparaît dans le code source d'origam. Cliquez sur l'icône de copie pour copier l'extrait.

typescript

Entrées

Valeurs

Toutes les entrées de cette constante. Cliquez sur une valeur pour la copier dans le presse-papiers.

open: MULTIPLE_OPEN_STRATEGY.open
select: ({id, value, opened, parents}) => { if (!value) return opened const path: Array<unknown> = [] let parent = parents.get(id) while (parent != null) { path.push(parent) parent = parents.get(parent) } return new Set(path) }

Écosystème

Utilisé par

Composables et composants qui consomment cette constante.

  • OrigamList

Usage

Exemples

Extraits de code prêts à coller utilisant cette constante.

Providing LIST_OPEN_STRATEGY to a nested list

typescript