findChildrenWithProvide
Commons
stable
Walks a Vue VNode tree and returns all ComponentInternalInstance nodes that have a specific injection key in their provides object. Used by layout components to locate child components registered via provide/inject.
API
Signature
Signature TypeScript complète, extraite du fichier util.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- keyrequisInjectionKey<any> | symbol
- The injection key to search for. Components that called provide(key, …) will be collected.
- vnodeVNodeChild
- The VNode subtree to walk. Typically the subTree of the parent component instance. Undefined returns an empty array.
API
Valeur de retour
La valeur retournée par cet util.
- A flat array of all component instances that provide the given key, found anywhere in the VNode subtree.
Usage
Exemples
Extraits de code prêts à coller.
Locate children by injection key