Home > PNL_Document > save
PNL_Document.save() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
保存文档
签名
typescript
function save(): Promise<boolean>;1
返回值
Promise<boolean>
保存操作是否成功,保存失败、上传失败等错误均返回 false
示例
javascript
// 1. 创建测试面板并打开(save 只对已打开的面板生效)
const panelUuid = await eda.dmt_Panel.createPanel();
await new Promise(r => setTimeout(r, 1500));
await eda.dmt_EditorControl.openDocument(panelUuid);
await new Promise(r => setTimeout(r, 1000));
// 2. 保存面板文档
const saved = await eda.pnl_Document.save();
console.log('saved:', saved);
// 3. 删除本例创建的测试面板,保持工程整洁
const deleted = await eda.dmt_Panel.deletePanel(panelUuid);
console.log('deleted:', deleted);1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13