Home > LIB_PanelLibrary > search
LIB_PanelLibrary.search() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
搜索面板库
签名
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
参数名
参数 | 类型 | 描述 |
|---|---|---|
key | string | 搜索关键字 |
libraryUuid | string | (可选) 库 UUID,默认为系统库,可以使用 LIB_LibrariesList 内的接口获取 |
classification | ILIB_ClassificationIndex | Array<string> | (可选) 分类,默认为全部 |
itemsOfPage | number | (可选) 一页搜索结果的数量 |
page | number | (可选) 页数 |
返回值
Promise<Array<ILIB_PanelLibrarySearchItem>>
搜索到的面板库属性列表
示例
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