Home > LIB_PanelLibrary > search
LIB_PanelLibrary.search() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Search panel library
Signature
typescript
function search(
key: string,
libraryUuid?: string,
classification?: ILIB_ClassificationIndex | Array<string>,
itemsOfPage?: number,
page?: number,
): Promise<Array<ILIB_PanelLibrarySearchItem>>;1
2
3
4
5
6
7
2
3
4
5
6
7
Parameters
Parameter | Type | Description |
|---|---|---|
key | string | Search keyword |
libraryUuid | string | (Optional) Library UUID, default is system library, you can use LIB_LibrariesList APIs in |
classification | ILIB_ClassificationIndex | Array<string> | (Optional) Classification, defaults to all |
itemsOfPage | number | (Optional) Number of search results per page |
page | number | (Optional) Page count |
Returns
Promise<Array<ILIB_PanelLibrarySearchItem>>
List of searched panel library properties
Example
javascript
// 1. 按空关键字列出系统库中的面板库,每页 5 条(换成 '三角' 等关键字即为按名称过滤)
const results = await eda.lib_PanelLibrary.search('', undefined, undefined, 5, 1);
// 2. 输出搜索结果
console.log('count:', results.length);
results.forEach((item, i) => {
console.log(`[${i}] name:`, item.name, 'uuid:', item.uuid, 'libraryUuid:', item.libraryUuid);
});1
2
3
4
5
6
7
8
2
3
4
5
6
7
8