Home > DMT_Folder > modifyFolderDescription
DMT_Folder.modifyFolderDescription() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
修改文件夹描述
签名
typescript
function modifyFolderDescription(
teamUuid: string,
folderUuid: string,
description?: string,
): Promise<boolean>;1
2
3
4
5
2
3
4
5
参数名
参数 | 类型 | 描述 |
|---|---|---|
teamUuid | string | 团队 UUID |
folderUuid | string | 文件夹 UUID |
description | string | (可选) 文件夹描述,如若为 |
返回值
Promise<boolean>
是否修改成功
备注
修改文件夹描述需要与工作区系统进行交互,修改操作存在延迟,需要短暂等待后才会呈现效果
示例
javascript
// 1. 取当前工程所属团队
const projectInfo = await eda.dmt_Project.getCurrentProjectInfo();
const teamUuid = projectInfo.teamUuid;
// 2. 创建带初始描述的测试文件夹,等 1.5s 让工作区同步
const folderUuid = await eda.dmt_Folder.createFolder('嘉立创示例_改描述', teamUuid, undefined, '嘉立创示例:旧描述');
await new Promise(r => setTimeout(r, 1500));
// 3. 修改文件夹描述
const modified = await eda.dmt_Folder.modifyFolderDescription(teamUuid, folderUuid, '嘉立创示例:更新后的描述');
// 4. 等 1s 让工作区同步,再回读验证
await new Promise(r => setTimeout(r, 1000));
const folderInfo = await eda.dmt_Folder.getFolderInfo(teamUuid, folderUuid);
console.log('modified:', modified);
console.log('description:', folderInfo?.description);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17