Browse Source

Revert accidental docs API regen

copilot/fix-publish-docs-job
copilot-swe-agent[bot] 2 months ago
committed by GitHub
parent
commit
3969c27471
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 14
      docs/api/component.md

14
docs/api/component.md

@ -177,16 +177,16 @@ also before rendering the component
### Parameters ### Parameters
* `query` **([String][1] | [Function][4])** Component type or matcher function * `query` **([String][1] | Function)** Component type or matcher function
* `opts` **[Object][2]** Search options (optional, default `{}`) * `opts` **[Object][2]?** Search options
* `opts.max` **[Number][12]?** Maximum number of matches before exiting
* `opts.max` **[Number][9]?** Maximum number of matches before exiting
### Examples ### Examples
```javascript ```javascript
const allImages = component.findType('image'); const allImages = component.findType('image');
console.log(allImages[0]) // prints the first found component console.log(allImages[0]) // prints the first found component
const someComponents = component.findType((cmp) => cmp.getType() === 'something', { max: 2 }); const someComponents = component.findType((cmp) => cmp.getType() === 'something', { max: 2 });
``` ```
@ -199,7 +199,7 @@ If no component is found, it returns `undefined`.
### Parameters ### Parameters
* `query` **([String][1] | [Function][4])** Component type or matcher function * `query` **([String][1] | Function)** Component type or matcher function
### Examples ### Examples
@ -208,6 +208,7 @@ const image = component.findFirstType('image');
if (image) { if (image) {
console.log(image); console.log(image);
} }
const firstImage = component.findFirstType((cmp) => cmp.is('image')); const firstImage = component.findFirstType((cmp) => cmp.is('image'));
``` ```
@ -239,13 +240,14 @@ also before rendering the component
### Parameters ### Parameters
* `query` **([String][1] | [Function][4])** Component type or matcher function * `query` **([String][1] | Function)** Component type or matcher function
### Examples ### Examples
```javascript ```javascript
const Section = component.closestType('section'); const Section = component.closestType('section');
console.log(Section); console.log(Section);
const namedSection = component.closestType((cmp) => cmp.getName() === 'Section'); const namedSection = component.closestType((cmp) => cmp.getName() === 'Section');
``` ```

Loading…
Cancel
Save