LIB_Cbb.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 Reuse block
Signature
typescript
function create(
libraryUuid: string,
cbbName: 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 |
cbbName | string | Reuse block name |
classification | ILIB_ClassificationIndex | Array<string> | (Optional) Classification |
description | string | (Optional) Description |
Returns
Promise<string | undefined>
Reuse block UUID
Example
javascript
// 1. 获取个人库 UUID
const libraryUuid = await eda.lib_LibrariesList.getPersonalLibraryUuid();
// 2. 在个人库创建复用模块(分类传空数组 = 不分类)
const cbbName = `嘉立创示例_新建模块_${Date.now()}`;
const cbbUuid = await eda.lib_Cbb.create(libraryUuid, cbbName, [], '示例描述');
// 创建类保留现场
console.log('libraryUuid:', libraryUuid);
console.log('cbbName:', cbbName);
console.log('cbbUuid:', cbbUuid);1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12