Home > LIB_Footprint > create
LIB_Footprint.create() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
创建封装
签名
typescript
function create(
libraryUuid: string,
footprintName: string,
classification?: ILIB_ClassificationIndex | Array<string>,
description?: string,
): Promise<string | undefined>;1
2
3
4
5
6
2
3
4
5
6
参数名
参数 | 类型 | 描述 |
|---|---|---|
libraryUuid | string | 库 UUID,可以使用 LIB_LibrariesList 内的接口获取 |
footprintName | string | 封装名称 |
classification | ILIB_ClassificationIndex | Array<string> | (可选) 分类 |
description | string | (可选) 描述 |
返回值
Promise<string | undefined>
封装 UUID
示例
javascript
// 1. 获取个人库 UUID
const libraryUuid = await eda.lib_LibrariesList.getPersonalLibraryUuid();
// 2. 创建封装(分类传 [] = 不分类)
const footprintName = `嘉立创示例_新封装_${Date.now()}`;
const footprintUuid = await eda.lib_Footprint.create(libraryUuid, footprintName, [], '示例封装描述');
// 创建类保留现场(新封装留在个人库中供观察)
console.log('footprintUuid:', footprintUuid);
console.log('footprintName:', footprintName);1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11