Home > DMT_Folder > modifyFolderName
DMT_Folder.modifyFolderName() method
Modify Folder name
Signature
typescript
function modifyFolderName(
teamUuid: string,
folderUuid: string,
folderName: string,
): Promise<boolean>;1
2
3
4
5
2
3
4
5
Parameters
Parameter | Type | Description |
|---|---|---|
teamUuid | string | Team UUID |
folderUuid | string | Folder UUID |
folderName | string | Folder name |
Returns
Promise<boolean>
Whether Modify Successful
Example
javascript
// 1. 取当前工程所属团队
const projectInfo = await eda.dmt_Project.getCurrentProjectInfo();
const teamUuid = projectInfo.teamUuid;
// 2. 创建测试文件夹并等待工作区同步
const folderUuid = await eda.dmt_Folder.createFolder('嘉立创示例_旧名称', teamUuid);
await new Promise(r => setTimeout(r, 1500));
// 3. 修改文件夹名称
const renamed = await eda.dmt_Folder.modifyFolderName(teamUuid, folderUuid, '嘉立创示例_新名称');
// 4. 等 1s 后回读,验证名称已更新
await new Promise(r => setTimeout(r, 1000));
const folderInfo = await eda.dmt_Folder.getFolderInfo(teamUuid, folderUuid);
console.log('renamed:', renamed);
console.log('name:', folderInfo?.name);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