Home > LIB_PanelLibrary > modify
LIB_PanelLibrary.modify() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
修改面板库
签名
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
参数名
参数 | 类型 | 描述 |
|---|---|---|
panelLibraryUuid | string | 面板库 UUID |
libraryUuid | string | 库 UUID,可以使用 LIB_LibrariesList 内的接口获取 |
panelLibraryName | string | (可选) 面板库名称 |
classification | ILIB_ClassificationIndex | Array<string> | null | (可选) 分类 |
description | string | null | (可选) 描述 |
返回值
Promise<boolean>
操作是否成功
备注
如希望清除某些属性,则将其的值设置为 null
示例
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