LIB_Cbb.delete() 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.
Delete Reuse block
Signature
typescript
function delete(cbbUuid: string, libraryUuid: string): Promise<boolean>;1
Parameters
Parameter | Type | Description |
|---|---|---|
cbbUuid | string | Reuse block UUID |
libraryUuid | string | Library UUID, you can use LIB_LibrariesList APIs in |
Returns
Promise<boolean>
Whether the operation is successful
Example
javascript
// 1. 获取系统库与个人库 UUID
const systemLib = await eda.lib_LibrariesList.getSystemLibraryUuid();
const personalLib = await eda.lib_LibrariesList.getPersonalLibraryUuid();
// 2. 复制一个系统库模块到个人库作为删除对象
const results = await eda.lib_Cbb.search('', systemLib, undefined, 1);
const source = results[0];
const cbbUuid = await eda.lib_Cbb.copy(source.uuid, systemLib, personalLib, [], `嘉立创示例_删除_${Date.now()}`);
// 3. 删除复制品
const deleted = await eda.lib_Cbb.delete(cbbUuid, personalLib);
console.log('cbbUuid:', cbbUuid);
console.log('deleted:', deleted);1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14