Home > LIB_PanelLibrary > modify
LIB_PanelLibrary.modify() 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.
Modify Panel library
Signature
typescript
function modify(
panelLibraryUuid: string,
libraryUuid: string,
panelLibraryName?: string,
classification?: ILIB_ClassificationIndex | Array<string> | null,
description?: string | null,
): Promise<boolean>;1
2
3
4
5
6
7
2
3
4
5
6
7
Parameters
Parameter | Type | Description |
|---|---|---|
panelLibraryUuid | string | Panel library UUID |
libraryUuid | string | Library UUID, you can use LIB_LibrariesList APIs in |
panelLibraryName | string | (Optional) Panel library name |
classification | ILIB_ClassificationIndex | Array<string> | null | (Optional) Classification |
description | string | null | (Optional) Description |
Returns
Promise<boolean>
Whether the operation is successful
Remarks
If you want to clear certain properties, set their values to null
Example
javascript
// 1. 获取个人库 UUID 并新建修改对象
const libraryUuid = await eda.lib_LibrariesList.getPersonalLibraryUuid();
const panelLibraryUuid = await eda.lib_PanelLibrary.create(
libraryUuid,
`嘉立创示例_面板库修改前_${Date.now()}`,
[],
'修改前的描述'
);
// 2. 修改名称和描述(分类保持不变传 [])
const newName = `嘉立创示例_面板库修改后_${Date.now()}`;
const modified = await eda.lib_PanelLibrary.modify(panelLibraryUuid, libraryUuid, newName, [], '修改后的描述');
// 修改类保留现场
console.log('panelLibraryUuid:', panelLibraryUuid);
console.log('modified:', modified);
console.log('newName:', newName);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18