Home > LIB_PanelLibrary > create
LIB_PanelLibrary.create() 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.
Create Panel library
Signature
typescript
function create(
libraryUuid: string,
panelLibraryName: string,
classification?: ILIB_ClassificationIndex | Array<string>,
description?: string,
): Promise<string | undefined>;1
2
3
4
5
6
2
3
4
5
6
Parameters
Parameter | Type | Description |
|---|---|---|
libraryUuid | string | Library UUID, you can use LIB_LibrariesList APIs in |
panelLibraryName | string | Panel library name |
classification | ILIB_ClassificationIndex | Array<string> | (Optional) Classification |
description | string | (Optional) Description |
Returns
Promise<string | undefined>
Panel library UUID
Example
javascript
// 1. 获取个人库 UUID
const libraryUuid = await eda.lib_LibrariesList.getPersonalLibraryUuid();
// 2. 创建面板库(分类传 [] = 不分类)
const panelLibraryName = `嘉立创示例_新面板库_${Date.now()}`;
const panelLibraryUuid = await eda.lib_PanelLibrary.create(libraryUuid, panelLibraryName, [], '示例面板库描述');
// 创建类保留现场(新面板库留在个人库中供观察)
console.log('panelLibraryUuid:', panelLibraryUuid);
console.log('panelLibraryName:', panelLibraryName);1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11